_init() protected method

protected _init ( )
Example #1
0
 protected function _init()
 {
     parent::_init();
     $this->_handlers += array('stdClass' => function ($item) {
         return $item;
     });
 }
Example #2
0
 protected function _init()
 {
     parent::_init();
     $this->_data = (array) $this->_data;
     if ($model = $this->_model) {
         $pathKey = $this->_pathKey;
         $this->_data = $model::connection()->cast($model, $this->_data, compact('pathKey'));
     }
     unset($this->_autoConfig);
 }
Example #3
0
 protected function _init()
 {
     parent::_init();
     $data = (array) $this->_data;
     $this->_data = array();
     $this->_updated = array();
     $this->_removed = array();
     $this->_handlers += array('MongoId' => function ($value) {
         return (string) $value;
     }, 'MongoDate' => function ($value) {
         return $value->sec;
     });
     $this->set($data, array('init' => true));
     $this->sync(null, array(), array('materialize' => $this->_exists));
     unset($this->_autoConfig);
 }
 protected function _init()
 {
     parent::_init();
     $data = (array) $this->_data;
     $this->_data = array();
     $this->_updated = array();
     $this->_removed = array();
     $this->set($data, array('init' => true));
     $this->sync(null, array(), array('materialize' => false));
     unset($this->_autoConfig);
 }
Example #5
0
 protected function _init()
 {
     parent::_init();
     $data = (array) $this->_data;
     $this->_data = array();
     $this->set($data);
     $exists = $this->_exists;
     $this->_data = $this->_updated;
     $this->_updated = array();
     $this->update();
     $this->_exists = $exists;
     unset($this->_autoConfig);
 }
Example #6
0
 protected function _init()
 {
     parent::_init();
     $this->_data = (array) $this->_data;
 }