Skip to content

Instantly share code, notes, and snippets.

@weierophinney
Created March 15, 2012 15:13
Show Gist options
  • Save weierophinney/2044728 to your computer and use it in GitHub Desktop.
Save weierophinney/2044728 to your computer and use it in GitHub Desktop.
<?php
function getEventManager()
{
$em = new EventManager();
$em->setStaticConnections($this->getGlobalEventManager());
return $em;
}
function getGlobalEventManager()
{
if ($this->globalEm instanceof StaticEventCollection) {
return $this->globalEm;
}
$this->globalEm = new NonStaticGlobalEventManager();
return $this->globalEm;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment