You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
405B

  1. <?php
  2. namespace Lc\SovBundle\Component;
  3. use Cocur\Slugify\Slugify;
  4. class ArrayComponent
  5. {
  6. public function contains(array $array, $entity): bool
  7. {
  8. foreach($array as $entityTest) {
  9. if(get_class($entityTest) == get_class($entity)
  10. && $entityTest->getId() == $entity->getId()) {
  11. return true;
  12. }
  13. }
  14. return false;
  15. }
  16. }