Example #1
0
 /**
  * @param \Application\Iphp\CoreBundle\Entity\Rubric $rubric
  * @return \Iphp\CoreBundle\Module\Module
  */
 function getModuleFromRubric(\Application\Iphp\CoreBundle\Entity\Rubric $rubric)
 {
     $moduleClassName = $rubric->getControllerName();
     if (!$moduleClassName) {
         return null;
     }
     $module = $this->getModuleInstance($moduleClassName);
     if (!$module) {
         return null;
     }
     return $module->setRubric($rubric);
 }
 /**
  * @param \Application\Iphp\CoreBundle\Entity\Rubric $rubric
  * @return \Iphp\CoreBundle\Module\Module
  */
 public function getModuleFromRubric(\Application\Iphp\CoreBundle\Entity\Rubric $rubric)
 {
     $moduleClassName = $rubric->getControllerName();
     if (!$moduleClassName) {
         return null;
     }
     $module = $this->getModuleInstance($moduleClassName);
     if (!$module) {
         return null;
     }
     if ($module instanceof ContainerAwareInterface) {
         $module->setContainer($this->container);
     }
     return $module->setRubric($rubric);
 }