ModelRecipeRecipe
extends Model
in package
ModelRecipeRecipe
The model for working with the recipe entity.
Table of Contents
Methods
- __get() : object
- A magic method for referring to objects.
- add() : bool
- This method adds a new recipe.
- get() : array<string|int, mixed>|bool
- This method returns a recipe object by its ID.
- getAll() : array<string|int, mixed>|bool
- This method returns all recipes given the request parameters.
- getAllCategories() : array<string|int, mixed>
- This method returns an array of all categories.
- getAllIngredients() : array<string|int, mixed>
- This method returns an array of all ingredients.
- getCategories() : array<string|int, mixed>
- This method returns the categories associated with a specific recipe by ID.
- getFeatured() : array<string|int, mixed>
- This method returns an array of popular recipe objects.
- getIngredients() : array<string|int, mixed>
- This method returns the ingredients associated with a specific recipe by ID.
- getQuantity() : int
- This method returns the number of recipes given the request parameters.
Methods
__get()
A magic method for referring to objects.
public
__get(string $property) : object
Made for more convenient access to objects from the model, as well as for more convenient replacement of objects, if necessary, so that you do not have to change all calls to objects in the entire code.
Parameters
- $property : string
Return values
objectadd()
This method adds a new recipe.
public
add(array<string|int, mixed> $data) : bool
Parameters
- $data : array<string|int, mixed>
Return values
boolget()
This method returns a recipe object by its ID.
public
get(int $id) : array<string|int, mixed>|bool
Parameters
- $id : int
Return values
array<string|int, mixed>|boolgetAll()
This method returns all recipes given the request parameters.
public
getAll([array<string|int, mixed> $query_vars = [] ]) : array<string|int, mixed>|bool
Parameters
- $query_vars : array<string|int, mixed> = []
Return values
array<string|int, mixed>|boolgetAllCategories()
This method returns an array of all categories.
public
getAllCategories() : array<string|int, mixed>
Return values
array<string|int, mixed>getAllIngredients()
This method returns an array of all ingredients.
public
getAllIngredients() : array<string|int, mixed>
Return values
array<string|int, mixed>getCategories()
This method returns the categories associated with a specific recipe by ID.
public
getCategories(int $id) : array<string|int, mixed>
Parameters
- $id : int
Return values
array<string|int, mixed>getFeatured()
This method returns an array of popular recipe objects.
public
getFeatured() : array<string|int, mixed>
Return values
array<string|int, mixed>getIngredients()
This method returns the ingredients associated with a specific recipe by ID.
public
getIngredients(int $id) : array<string|int, mixed>
Parameters
- $id : int
Return values
array<string|int, mixed>getQuantity()
This method returns the number of recipes given the request parameters.
public
getQuantity([array<string|int, mixed> $query_vars = [] ]) : int
Parameters
- $query_vars : array<string|int, mixed> = []