src/Controller/Console/PurgeController.php
private function entityToString(EntityInterface $entity)
    {
        if (method_exists($entity, '__toString')) {
            return $entity->__toString();
        }

        $str = get_class($entity);

        if ($entity instanceof \Core\Entity\IdentifiableEntityInterface) {
            $str .= '( ' . $entity->getId() . ' )';
        }

        return $str;
    }
private function entityToString(EntityInterface $entity)
    {
        if (method_exists($entity, '__toString')) {
            return $entity->__toString();
        }

        $str = get_class($entity);

        if ($entity instanceof \Core\Entity\IdentifiableEntityInterface) {
            $str .= '( ' . $entity->getId() . ' )';
        }

        return $str;
    }
Get a string representation from an entity.

Uses the entitys' __toString method, if available.
Otherwise just returns the class name and if available, the ID.

@param EntityInterface $entity

@return string