Exemplo n.º 1
0
 public function __construct($resourceName, $eventName, $data = null)
 {
     parent::__construct($resourceName, $eventName, $data);
     trigger_error(get_class($this) . " has been deprecated in v3.1 and will be removed by v4.0. Please use " . get_parent_class($this) . " instead.", E_USER_NOTICE);
 }
Exemplo n.º 2
0
 /**
  *     Object constructor to set table and key field. This should be overridden by all submodules
  *
  * @param string $table     name of the table in the db schema relating to child class
  * @param string $key       name of the primary key field in the table
  * @param string $module    name as stored in the 'mod_directory' of the 'modules' table, and the 'value' field of the 'gacl_axo' table. It is used for permission checking in situations where the table name is different from the module folder name. For compatibility sake this variable is set equal to the $table if not set as failsafe.
  */
 public function __construct($table, $key, $module = '')
 {
     $this->_error = array();
     $this->_tbl = $table;
     $this->_tbl_key = $key;
     $this->_tbl_module = '' == $module ? $table : $module;
     $this->_tbl_prefix = w2PgetConfig('dbprefix', '');
     $this->_query = new w2p_Database_Query();
     /**
      * I hate this global but this will allow us to get rid of all the
      *   others, so I think it's the best approach for now.
      *                                           ~ caseydk 27 Dec 2011
      */
     global $AppUI;
     $this->_AppUI = is_null($AppUI) ? new w2p_Core_CAppUI() : $AppUI;
     $this->_perms = $this->_AppUI->acl();
     global $locale_char_set;
     $this->_locale_char_set = $locale_char_set;
     /**
      * This block does a lot and may need to be simplified.. but the point
      *   is that it sets up all of our base Events for later notifications,
      *   logging, etc. We also need a way to enable Core Modules (CProject,
      *   CTask, etc) and Add On Modules to add their own hooks.
      */
     $this->_dispatcher = new w2p_System_Dispatcher();
     $this->_dispatcher->subscribe($this, get_class($this), 'preStoreEvent');
     $this->_dispatcher->subscribe($this, get_class($this), 'postStoreEvent');
     $this->_dispatcher->subscribe($this, get_class($this), 'preCreateEvent');
     $this->_dispatcher->subscribe($this, get_class($this), 'postCreateEvent');
     $this->_dispatcher->subscribe($this, get_class($this), 'preUpdateEvent');
     $this->_dispatcher->subscribe($this, get_class($this), 'postUpdateEvent');
     $this->_dispatcher->subscribe($this, get_class($this), 'preDeleteEvent');
     $this->_dispatcher->subscribe($this, get_class($this), 'postDeleteEvent');
     $this->_dispatcher->subscribe($this, get_class($this), 'preLoadEvent');
     $this->_dispatcher->subscribe($this, get_class($this), 'postLoadEvent');
     parent::__construct($this->_tbl_module, get_class($this), array());
 }