Esempio n. 1
0
    protected function _initialize(KConfig $config)
    {
        $config->append(array(
            'identity_column' => 'name'
        ));

        parent::_initialize($config);
    }
Esempio n. 2
0
 /**
  * Set the rowset data based on a named array/hash
  *
  * @param   array   An associative array of data
  * @param   boolean If TRUE, update the modified information for each column being set.
  *                  Default TRUE
  * @return  KDatabaseRowsetAbstract
  */
 public function setData($data, $modified = true)
 {
     //Set the data in the rows
     if (isset($data[$this->getIdentifier()->name])) {
         foreach ($data[$this->getIdentifier()->name] as $key => $data) {
             $this->_object_set->offsetGet($key)->setData($data, $modified);
         }
     } else {
         parent::setData($data, $modified);
     }
     return $this;
 }
Esempio n. 3
0
 public function __construct(KConfig $config)
 {
     $config->append(array('identitiy_columns' => 'id'));
     parent::__construct($config);
 }
Esempio n. 4
0
 /**
  * Forward the call to each row
  *
  * This functions overloads KDatabaseRowsetAbstract::__call and implements
  * a just in time mixin strategy. Available table behaviors are only mixed
  * when needed.
  *
  * @param  string 	The function name
  * @param  array  	The function arguments
  * @throws BadMethodCallException 	If method could not be found
  * @return mixed The result of the function
  */
 public function __call($method, array $arguments)
 {
     // If the method hasn't been mixed yet, load all the behaviors.
     if ($this->isConnected() && !isset($this->_mixed_methods[$method])) {
         foreach ($this->getTable()->getBehaviors() as $behavior) {
             $this->mixin($behavior);
         }
     }
     return parent::__call($method, $arguments);
 }
Esempio n. 5
0
 protected function _initialize(KConfig $config)
 {
     $config->append(array('load_data' => true));
     parent::_initialize($config);
 }
Esempio n. 6
0
 /**
  * Get the entity key
  *
  * @return string
  */
 public function getIdentityKey()
 {
     return parent::getIdentityColumn();
 }