protected function prepareUpdateData($data)
 {
     //check organization name to be unique
     if ($data['name_organization']) {
         $conditions['where']['name_organization'] = $data['name_organization'];
         if ($data['id_row']) {
             $conditions['where'][] = "id_row != '" . $data['id_row'] . "'";
         } else {
             if ($data['nid']) {
                 $conditions['where'][] = "nid != " . $data['nid'];
             }
         }
         $rs = $this->fetch($conditions);
         if ($rs->count() > 0) {
             throw new \Tee\Exception\ValidateException('Organization name was already registered. Please use a different name.');
         }
     }
     return parent::prepareUpdateData($data);
 }
Example #2
0
 protected function prepareUpdateData($data)
 {
     $data = $this->prepareData($data);
     return parent::prepareUpdateData($data);
 }