_init() protected method

protected _init ( )
Example #1
0
 protected function _init()
 {
     parent::_init();
     $this->_original = $this->_data;
     $this->_handlers += array('MongoId' => function ($value) {
         return (string) $value;
     }, 'MongoDate' => function ($value) {
         return $value->sec;
     });
 }
Example #2
0
 /**
  * Initializes the record set and uses the database handle to get the column list contained in
  * the query that created this object.
  *
  * @see lithium\data\collection\RecordSet::$_columns
  * @return void
  * @todo The part that uses _handle->schema() should be rewritten so that the column list
  *       is coming from the query object.
  */
 protected function _init()
 {
     parent::_init();
     if ($this->_handle && $this->_result) {
         $this->_columns = $this->_columnMap();
     }
     if ($this->_data && !$this->_index) {
         $this->_index = array_keys($this->_data);
         $this->_data = array_values($this->_data);
     }
 }
Example #3
0
 /**
  * Initializes the record set and uses the database connection to get the column list contained
  * in the query that created this object.
  *
  * @see lithium\data\collection\RecordSet::$_columns
  * @return void
  * @todo The part that uses _handle->schema() should be rewritten so that the column list
  *       is coming from the query object.
  */
 protected function _init()
 {
     parent::_init();
     if ($this->_result) {
         $this->_columns = $this->_columnMap();
         if ($this->_query) {
             $columns = array_filter(array_keys($this->_columns));
             $this->_dependencies = Set::expand(Set::normalize($columns));
             $this->_keyIndex = $this->_keyIndex('');
         }
     }
 }
Example #4
0
 /**
  * Initializes the record set and uses the database connection to get the column list contained
  * in the query that created this object.
  *
  * @see lithium\data\collection\RecordSet::$_columns
  * @return void
  * @todo The part that uses _handle->schema() should be rewritten so that the column list
  *       is coming from the query object.
  */
 protected function _init()
 {
     parent::_init();
     if (!$this->_result) {
         return;
     }
     $this->_columns = $this->_columnMap();
     if (!$this->_query) {
         return;
     }
     $this->_keyIndex = $this->_keyIndex();
     $this->_dependencies = Set::expand(Set::normalize(array_filter(array_keys($this->_columns))));
     $this->_relationships = $this->_query->relationships();
 }
Example #5
0
 protected function _init()
 {
     parent::_init();
     $this->_original = $this->_data;
 }