Example #1
0
 function __construct($owner)
 {
     parent::__construct($owner);
     $this->_key = $this->_module . (empty($this->_nodeName) ? '' : "." . $this->_nodeName);
     $api = get_class_methods($this);
     $me = is_object($this->_owner);
     if ($me) {
         $me = method_exists($this->_owner, 'delegate');
     }
     foreach ($api as $name) {
         if (preg_match(self::delegate, $name)) {
             $event = lcfirst(preg_replace(self::delegate, '\\2', $name));
             $type = preg_replace(self::delegate, '\\1', $name);
             if ($me) {
                 $this->owner->delegate($type, $this->_key, $event);
             }
         }
     }
 }
Example #2
0
File: api.php Project: vgrish/xblib
 function __construct($owner)
 {
     parent::__construct($owner);
     if (is_object($this->_owner)) {
         if (method_exists($this->_owner, 'registerMethod')) {
             if (is_array($this->_exports)) {
                 foreach ($this->_exports as $method) {
                     $this->owner->registerMethod($method, array($this, $method));
                 }
             } else {
                 $methods = get_class_methods($this);
                 foreach ($methods as $method) {
                     if (!in_array($method, array('error', 'load', 'remove'))) {
                         if (preg_match('/^([[:alpha:]])([[:alpha:]\\d])$/', $method)) {
                             $this->owner->registerMethod($method, array($this, $method));
                         }
                     }
                 }
             }
         }
     }
 }
Example #3
0
 function __construct($owner)
 {
     parent::__construct($owner);
 }