public function __construct(KConfig $config) { parent::__construct($config); if ($config->fields) { $this->setFields(KConfig::unbox($config->fields)); } }
/** * Constructor. * * @param KObjectConfig $config An optional KObjectConfig object with configuration options. */ public function __construct(KObjectConfig $config) { parent::__construct($config); $this->addCommandCallback('after.save' , 'saveThumbnail'); $this->addCommandCallback('after.delete', 'deleteThumbnail'); }
/** * Deletes the row and the row children from the database. * * @return KDatabaseRowAbstract */ public function delete() { parent::delete(); $query = $this->_table->getDatabase()->getQuery(); $query->where('path', 'like', '%' . $this->id . '%'); $this->_table->delete($query); return $this; }
protected function _initialize(KConfig $config) { $config->append( array('table' => null) ); parent::_initialize($config); }
/** * Initializes the options for the object * * Called from {@link __construct()} as a first step of object instantiation. * * @param object An optional KConfig object with configuration options * @return void */ protected function _initialize(KConfig $config) { $config->append(array( 'dependents' => array('com://admin/categories.model.categories.parent'), )); parent::_initialize($config); }
/** * Initializes the options for the object * * Called from {@link __construct()} as a first step of object instantiation. * * @param object An optional KConfig object with configuration options * @return void */ protected function _initialize(KConfig $config) { $config->append(array( 'table' => KFactory::get('com://admin/versions.database.table.revisions') )); parent::_initialize($config); }
/** * Get the methods that are available for mixin based * * This functions allows for conditional mixing of the behavior. Only if * the mixer has a 'path' property the behavior will allow to be * mixed in. * * @param object The mixer requesting the mixable methods. * @return array An array of methods */ public function getMixableMethods(KObject $mixer = null) { $methods = array(); if (isset($mixer->path)) { $methods = parent::getMixableMethods($mixer); } return $methods; }
protected function _initialize(KObjectConfig $config) { $config->append(array( 'priority' => self::PRIORITY_HIGHEST, )); parent::_initialize($config); }
/** * Get the methods that are available for mixin based * * This function conditionaly mixes the behavior. Only if the mixer * has a 'modified_by' or 'modified_by' property the behavior will * be mixed in. * * @param object The mixer requesting the mixable methods. * @return array An array of methods */ public function getMixableMethods(KObject $mixer = null) { $methods = array(); if (isset($mixer->modified_by) || isset($mixer->modified_on)) { $methods = parent::getMixableMethods($mixer); } return $methods; }
/** * Get the methods that are available for mixin based * * This function conditionaly mixes of the behavior. Only if the mixer * has a 'uuid' property the behavior will be mixed in. * * @param object The mixer requesting the mixable methods. * @return array An array of methods */ public function getMixableMethods(KObject $mixer = null) { $methods = array(); if (isset($mixer->uuid)) { $methods = parent::getMixableMethods($mixer); } //Lazy load the random number $this->_urand = @fopen('/dev/urandom', 'rb'); return $methods; }
public function __construct(KConfig $config) { parent::__construct($config); if (!$config->offset_column) { $config->offset_column = $this->getMixer()->getIdentityColumn(); } $this->_table_alias = $config->table_alias; $this->_limit = $config->limit; $this->_offset = $config->offset; $this->_offset_column = $config->offset_column; }
/** * Initializes the options for the object * * Called from {@link __construct()} as a first step of object instantiation. * * @param object An optional KConfig object with configuration options * @return void */ protected function _initialize(KConfig $config) { $config->append(array('table' => $this->getService('com://admin/versions.database.table.revisions'))); parent::_initialize($config); }
protected function _initialize(KObjectConfig $config) { $config->append(array('row_column' => 'id')); parent::_initialize($config); }
protected function _initialize(KConfig $config) { $config->append(array('priority' => KCommand::PRIORITY_LOWEST)); parent::_initialize($config); }
/** * Initializes the options for the object * * Called from {@link __construct()} as a first step of object instantiation. * * @param KObjectConfig $config Configuration options * @return void */ protected function _initialize(KObjectConfig $config) { $config->append(array('columns' => 'title', 'separator' => '-', 'updatable' => true, 'length' => null, 'unique' => null)); parent::_initialize($config); }
/** * Initializes the options for the object * * Called from {@link __construct()} as a first step of object instantiation. * * @param KObjectConfig $config Configuration options * @return void */ protected function _initialize(KObjectConfig $config) { $config->append(array('priority' => self::PRIORITY_HIGH, 'lifetime' => $this->getObject('user')->getSession()->getLifetime())); $this->_lifetime = $config->lifetime; parent::_initialize($config); }
protected function _initialize(KObjectConfig $config) { $config->append(array('columns' => array())); parent::_initialize($config); }
/** * Intercept parameter getter and setter calls * * @param string $method The function name * @param array $arguments The function arguments * @throws BadMethodCallException If method could not be found * @return mixed The result of the function */ public function __call($method, $arguments) { if ($this->_column !== 'parameters') { //Call getParameters() if ($method == 'get' . ucfirst($this->_column)) { return $this->getParameters(); } //Call setPropertyParameters() if ($method == 'setProperty' . ucfirst($this->_column)) { return $this->setPropertyParameters($arguments[0]); } } return parent::__call($method, $arguments); }
public function __construct(KConfig $config) { $this->_ancestors = $config->ancestors ? $config->ancestors : new KConfig(); $this->_descendants = $config->descendants ? $config->descendants : new KConfig(); parent::__construct($config); }
/** * Initializes the options for the object * * Called from {@link __construct()} as a first step of object instantiation. * * @param KObjectConfig $config An optional ObjectConfig object with configuration options * @return void */ protected function _initialize(KObjectConfig $config) { $config->append(array('auto_generate' => true)); parent::_initialize($config); }