src/Model/DoctrineModel.php
protected function removeEntity (...$entities) : void
    {
        try
        {
            $entities = \array_filter($entities);

            if (empty($entities))
            {
                return;
            }

            $entityManager = $this->getEntityManager();
            \array_map([$entityManager, "remove"], $entities);
            $entityManager->flush();
        }
        catch (ForeignKeyConstraintViolationException $foreignKeyException)
        {
            throw new EntityRemovalBlockedException(
                $entities,
                "Can't remove entities as a foreign key constraint failed.",
                $foreignKeyException
            );
        }
    }
protected function removeEntity (...$entities) : void
    {
        try
        {
            $entities = \array_filter($entities);

            if (empty($entities))
            {
                return;
            }

            $entityManager = $this->getEntityManager();
            \array_map([$entityManager, "remove"], $entities);
            $entityManager->flush();
        }
        catch (ForeignKeyConstraintViolationException $foreignKeyException)
        {
            throw new EntityRemovalBlockedException(
                $entities,
                "Can't remove entities as a foreign key constraint failed.",
                $foreignKeyException
            );
        }
    }
protected function removeEntity ( ... $ entities ) : void { try { $ entities = \ array_filter ( $ entities ) ; if ( empty ( $ entities ) ) { return ; } $ entityManager = $ this -> getEntityManager ( ) ; \ array_map ( [ $ entityManager , "remove" ] , $ entities ) ; $ entityManager -> flush ( ) ; } catch ( ForeignKeyConstraintViolationException $ foreignKeyException ) { throw new EntityRemovalBlockedException ( $ entities , "Can't remove entities as a foreign key constraint failed." , $ foreignKeyException ) ; } }
Removes the given entities.

@param object[] ...$entities
Removes the given entities .