38 lines
935 B
PHP
38 lines
935 B
PHP
<?php
|
|
|
|
namespace App\Domain\Ingredients;
|
|
|
|
use App\Domain\Model;
|
|
|
|
/**
|
|
* Interface utilisée par tous les repository qui sont en lien avec les ingrédients.
|
|
*/
|
|
interface UseIngredientsInterface {
|
|
|
|
/**
|
|
* Permet de récupérer tous les ingrédients liés à ce Modèle.
|
|
* @return array|null
|
|
*/
|
|
public function getAllLinkedIngredients( Model $entity ): ?array;
|
|
|
|
/**
|
|
* Permet d'ajouter un ingrédient en lien avec notre autre entité.
|
|
*
|
|
* @param Ingredient $ingredient
|
|
* @param Model $entity
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function addAnIngredient( Ingredient $ingredient, Model $entity ): bool;
|
|
|
|
/**
|
|
* Permet de retirer un lien entre un ingrédient et une autre entité.
|
|
*
|
|
* @param Ingredient $ingredient
|
|
* @param Model $entity
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function removeAnIngredient( Ingredient $ingredient, Model $entity ): bool;
|
|
|
|
} |