Beispiel #1
0
 protected function _load_values(array $values)
 {
     if (isset($values[$this->_name_field])) {
         $this->name = $values[$this->_name_field];
     }
     return parent::_load_values($values);
 }
Beispiel #2
0
 protected function _load_values(array $values)
 {
     if (!empty($values['data'])) {
         $values['data'] = Kohana::unserialize($values['data']);
     }
     parent::_load_values($values);
 }
Beispiel #3
0
 /**
  * extension of ORM _load_values method, this is called each time the data for
  * this object is retrieved from the DB.  This extension adds extra functionality
  * to instatiate the item object each time the basket item is loaded.
  * 
  * @param   array 				$values 	 Values to load
  * @return 	Model_Basket_Item
  */
 public function _load_values(array $values)
 {
     $basket_item = parent::_load_values($values);
     if ($basket_item->item_type !== NULL and $basket_item->item_identifier != NULL) {
         // instatiate the item
         $item = call_user_func($basket_item->item_type . '::find_by_id', $basket_item->item_identifier);
         $basket_item->set_item($item);
     }
     return $basket_item;
 }