public prePersist ( Doctrine\Common\Persistence\Event\LifecycleEventArgs $args ) : mixed | void | ||
$args | Doctrine\Common\Persistence\Event\LifecycleEventArgs | |
return | mixed | void |
public function prePersist(LifecycleEventArgs $args)
{
$entity = $args->getObject();
if ($entity instanceof ContentRoute) {
$template = $this->templates[$entity->getTemplateName()];
$entity->setTemplate($template['template']);
$entity->setController($template['controller']);
}
}