/** * Transforms an object (usuario) to a string (id). * * @param entity|null $entity * @return string */ public function transform($entity) { if (null === $entity) { return $this->id; } return $entity->getId(); }
/** * Return front url of the entity * @param entity $entity The entity to get front url * @return string Url */ public function getFrontUrlRedirection($entity) { return $this->container->get('Devgiants.seo.tools')->getFrontUrlRedirection($entity->getId(), $entity->getSlug(), (new \ReflectionClass($entity))->getShortName()); }