/**
  * Set the rowset data based on a named array/hash
  *
  * @param   array   $data     An associative array of data
  * @param   boolean $modified If TRUE, update the modified information for each column being set. Default TRUE
  * @return  Library\DatabaseRowsetAbstract
  */
 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;
 }
 protected function _initialize(Library\ObjectConfig $config)
 {
     $config->identity_column = 'id';
     parent::_initialize($config);
 }
 /**
  * Constructor
  *
  * @param Library\ObjectConfig $config  An optional Library\ObjectConfig object with configuration options
  * @return Library\DatabaseRowsetAbstract
  */
 public function __construct(Library\ObjectConfig $config)
 {
     parent::__construct($config);
     $this->_object_set->setIteratorClass('\\RecursiveArrayIterator');
 }
Exemple #4
0
 protected function _initialize(Library\ObjectConfig $config)
 {
     $config->append(array('identity_column' => 'name'));
     parent::_initialize($config);
 }
 protected function _initialize(Library\ObjectConfig $config)
 {
     $config->append(array('identity_column' => 'id', 'status' => Library\Database::STATUS_FETCHED));
     parent::_initialize($config);
 }