learen more with autoformation

mardi 7 octobre 2014

On 16:36 by مشاهير العرب   No comments
Trait Example From ZF2

namespace Zend\EventManager;
trait ProvidesEvents
{
public function setEventManager(EventManagerInterface $events)
{
$identifiers = array(__CLASS__, get_called_class());
$events->setIdentifiers($identifiers);
$this->events = $events;
return $this;
}
public function getEventManager()
{
if (!$this->events instanceof EventManagerInterface) {
$this->setEventManager(new EventManager());
}
return $this->events;
}
}

0 commentaires:

Enregistrer un commentaire