Add shopping list manipulation
This commit is contained in:
@ -8,6 +8,7 @@ use Ardent\GrocyApi\Objects\AbstractApiObject;
|
||||
use Ardent\GrocyApi\Objects\ObjectTransformer;
|
||||
use Ardent\GrocyApi\Objects\ProductsObject;
|
||||
use Ardent\GrocyApi\Objects\QuantityUnitsObject;
|
||||
use Ardent\GrocyApi\Objects\ShoppingListObject;
|
||||
|
||||
class GrocyClient
|
||||
{
|
||||
@ -46,6 +47,14 @@ class GrocyClient
|
||||
return $this->getObjects('quantity_units');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ShoppingListObject[]
|
||||
*/
|
||||
public function getShoppingListProducts(): array
|
||||
{
|
||||
return $this->getObjects('shopping_list');
|
||||
}
|
||||
|
||||
public function getProduct(int $id): ProductsObject
|
||||
{
|
||||
return $this->getObject('products', $id);
|
||||
@ -78,6 +87,11 @@ class GrocyClient
|
||||
]);
|
||||
}
|
||||
|
||||
public function getStockClient(): StockClient
|
||||
{
|
||||
return new StockClient($this->client);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return AbstractApiObject[]
|
||||
*/
|
||||
|
Reference in New Issue
Block a user