public function __construct(\Cx\Core\Core\Model\Entity\SystemComponent $systemComponent, \Cx\Core\Core\Controller\Cx $cx) { parent::__construct($systemComponent, $cx); $evm = $cx->getEvents(); $pageListener = new \Cx\Core\ContentManager\Model\Event\PageEventListener(); $evm->addModelListener(\Doctrine\ORM\Events::prePersist, 'Cx\\Core\\ContentManager\\Model\\Entity\\Page', $pageListener); $evm->addModelListener(\Doctrine\ORM\Events::postPersist, 'Cx\\Core\\ContentManager\\Model\\Entity\\Page', $pageListener); $evm->addModelListener(\Doctrine\ORM\Events::preUpdate, 'Cx\\Core\\ContentManager\\Model\\Entity\\Page', $pageListener); $evm->addModelListener(\Doctrine\ORM\Events::postUpdate, 'Cx\\Core\\ContentManager\\Model\\Entity\\Page', $pageListener); $evm->addModelListener(\Doctrine\ORM\Events::preRemove, 'Cx\\Core\\ContentManager\\Model\\Entity\\Page', $pageListener); $evm->addModelListener(\Doctrine\ORM\Events::postRemove, 'Cx\\Core\\ContentManager\\Model\\Entity\\Page', $pageListener); $evm->addModelListener(\Doctrine\ORM\Events::onFlush, 'Cx\\Core\\ContentManager\\Model\\Entity\\Page', $pageListener); $nodeListener = new \Cx\Core\ContentManager\Model\Event\NodeEventListener(); $evm->addModelListener(\Doctrine\ORM\Events::preRemove, 'Cx\\Core\\ContentManager\\Model\\Entity\\Node', $nodeListener); $evm->addModelListener(\Doctrine\ORM\Events::onFlush, 'Cx\\Core\\ContentManager\\Model\\Entity\\Node', $nodeListener); $evm->addModelListener(\Doctrine\ORM\Events::onFlush, 'Cx\\Core\\ContentManager\\Model\\Entity\\LogEntry', new \Cx\Core\ContentManager\Model\Event\LogEntryEventListener()); }
/** * Registers the event * * New logs can be added using: * $this->cx->getEvents()->triggerEvent('SysLog/Add', array( * 'severity' => 'INFO', * 'message' => 'my log message', * 'data' => 'additional debugging data', * )); * @param \Cx\Core\Core\Model\Entity\SystemComponent $systemComponent SystemComponent entity for this component * @param \Cx\Core\Core\Controller\Cx $cx Current Cx class instance */ public function __construct(\Cx\Core\Core\Model\Entity\SystemComponent $systemComponent, \Cx\Core\Core\Controller\Cx $cx) { parent::__construct($systemComponent, $cx); $cx->getEvents()->addEvent(static::EVENT_NAME); $cx->getEvents()->addEventListener(static::EVENT_NAME, $this); }
/** * Creates new controller * @param SystemComponentController $systemComponentController Main controller for this system component * @param \Cx\Core\Core\Controller\Cx $cx Main class instance */ public function __construct(SystemComponentController $systemComponentController, \Cx\Core\Core\Controller\Cx $cx) { $this->cx = $cx; $this->systemComponentController = $systemComponentController; $this->systemComponentController->registerController($this); }
public function __construct(\Cx\Core\Core\Model\Entity\SystemComponent $systemComponent, \Cx\Core\Core\Controller\Cx $cx) { parent::__construct($systemComponent, $cx); }
/** * Wrapper to __call() * Thank you Zend! * @return string ComponentName */ public function getName() { return parent::getName(); }
public function __construct(SystemComponent $systemComponent, Cx $cx) { parent::__construct($systemComponent, $cx); $eventHandlerInstance = $cx->getEvents(); $eventHandlerInstance->addEvent('mediasource.load'); }