| 1 | <?php |
||
| 8 | abstract class AbstractEntityService |
||
| 9 | { |
||
| 10 | /** @var EntityManagerInterface L'entity manager */ |
||
| 11 | protected $em; |
||
| 12 | |||
| 13 | /** @var ValidatorInterface Le service pour la validation des data */ |
||
| 14 | protected $validator; |
||
| 15 | |||
| 16 | protected function __construct(EntityManagerInterface $em, ValidatorInterface $validator) |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Filtre les champs de $datas qui correspondent à ceux de $entity en se basant sur les groupes de validations. |
||
| 24 | * Permet de scénariser les modifications d'entités grace aux groupes de validation. |
||
| 25 | * |
||
| 26 | * @see https://symfony.com/doc/current/validation/groups.html |
||
| 27 | * |
||
| 28 | * @param array $datas |
||
| 29 | * @param array $validation_groups |
||
| 30 | * @param AbstractEntity $entity |
||
| 31 | * |
||
| 32 | * @return array |
||
| 33 | */ |
||
| 34 | protected function filterDataByValidationGroups(array $datas, array $validation_groups, AbstractEntity $entity) |
||
| 50 | } |
||
| 51 |