Example #1
0
 public function save(array $values, Validation $validation = NULL)
 {
     $parent_return = parent::save($values, $validation);
     $prop_values = Arr::get($values, 'properties', array());
     if (Ku_Upload::valid($prop_values)) {
         $prop_values = Helper_Property::extract_files($prop_values);
     }
     $files = Arr::get($_FILES, 'properties', array());
     $prop_values = $prop_values + Helper_Property::extract_files($files);
     unset($files);
     if (!empty($prop_values)) {
         $orm = $this->_orm;
         $user_id = 0;
         if (array_key_exists('creator_id', $orm->table_columns())) {
             $user_id = $orm->creator_id;
         }
         $helper_propery = $this->property_helper();
         $helper_propery->set_owner_id($orm->id);
         $helper_propery->set_user_id($user_id);
         foreach ($prop_values as $_name => $_value) {
             $helper_propery->set($_name, $_value);
         }
         $this->property_cache_clear();
     }
     return $parent_return;
 }
Example #2
0
 public function save(array $values, Validation $validation = NULL)
 {
     $this->_set_file_fields();
     return parent::save($values, $validation);
 }