Files
LesRecettesDePapis/src/Domain/Ingredients/UseIngredientsInterface.php

38 lines
935 B
PHP
Raw Normal View History

2026-04-02 18:10:47 +02:00
<?php
namespace App\Domain\Ingredients;
use App\Domain\Model;
/**
* Interface utilisée par tous les repository qui sont en lien avec les ingrédients.
*/
2026-04-02 18:10:47 +02:00
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
*/
2026-04-02 18:10:47 +02:00
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
*/
2026-04-02 18:10:47 +02:00
public function removeAnIngredient( Ingredient $ingredient, Model $entity ): bool;
}