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;
    }