westdc-core/Westdc/EventModel/AbstractEventManager.php

35 lines
722 B
PHP
Raw Normal View History

<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2014/11/10
* Time: 11:43
*/
namespace Westdc\EventModel;
use Zend\EventManager\EventManagerInterface;
use Zend\EventManager\EventManager;
use Zend\EventManager\EventManagerAwareInterface;
abstract class AbstractEventManager {
public function setEventManager (EventManagerInterface $events) {
$events->setIdentifiers(array(
__CLASS__,
get_called_class(),
));
$this->events = $events;
return $this;
}
public function getEventManager () {
if (NULL === $this->events) {
$this->setEventManager(new EventManager());
}
return $this->events;
}
}