示例#1
0
 public function getEntityPath($entity, $arg1 = null, $arg2 = null, $arg3 = null)
 {
     $path = $this->entityRouter->entitySitePath($entity, $arg1, $arg2, $arg3);
     if (substr($path, 0, strlen($this->rubricManager->getBaseUrl())) != $this->rubricManager->getBaseUrl()) {
         $path = $this->rubricManager->getBaseUrl() . $path;
     }
     return $path;
 }
示例#2
0
 public function getEntityPath($entity, $arg1 = null, $arg2 = null, $arg3 = null)
 {
     if (!method_exists($entity, 'getSitePath')) {
         return 'method ' . get_class($entity) . '->getSitePath() not defined';
         throw new \Exception('method ' . get_class($entity) . '->getSitePath() not defined');
     }
     $methodData = new \ReflectionMethod($entity, 'getSitePath');
     $parameters = $methodData->getParameters();
     $args = array($arg1, $arg2, $arg3);
     if (sizeof($parameters) > 0 && $parameters[0]->getClass() && $parameters[0]->getClass()->isInstance($this->entityRouter)) {
         array_unshift($args, $this->entityRouter);
     }
     //Нельзя автоматом подставлять $this->rubricManager->getBaseUrl() т.к. метод getSitePath\
     //может использовать entityRouter который сгенерирует путь уже с базовым урлом (app_dev.php)
     $path = call_user_func_array(array($entity, 'getSitePath'), $args);
     if (substr($path, 0, strlen($this->rubricManager->getBaseUrl())) != $this->rubricManager->getBaseUrl()) {
         $path = $this->rubricManager->getBaseUrl() . $path;
     }
     return $path;
 }
示例#3
0
 public function postPersist($object)
 {
     $this->rubricManager->clearCache();
 }
示例#4
0
 public function getRubric()
 {
     // return 'Rubrica '.$this->request->get ('_rubric');
     return $this->rubricManager->getCurrent();
 }
示例#5
0
 public function getRubricRepo()
 {
     return $this->rubricManager->getRepository();
 }