예제 #1
0
 /**
  *  Class contructor
  *
  *  This is class is private, so it can be contructed
  *  only using the singleton interfaz.
  *
  *  This method also setup all needed hooks
  *
  *  @return void
  */
 private function __construct()
 {
     ActiveMongo::addEvent('before_query', array($this, 'QueryRead'));
     ActiveMongo::addEvent('after_query', array($this, 'QuerySave'));
     ActiveMongo::addEvent('after_create', array($this, 'UpdateDocumentHook'));
     ActiveMongo::addEvent('after_update', array($this, 'UpdateDocumentHook'));
 }
예제 #2
0
 function testSuperHooks()
 {
     ActiveMongo::addEvent('test_event', array($this, 'super_hook'));
     $c = new Model1();
     $c->triggerEvent('test_event', array('param1'));
 }
예제 #3
0
 private static final function _hook($action, $method)
 {
     ActiveMongo::addEvent($action, array(__CLASS__, $method));
 }