Exemple #1
0
 public function update(RecordInterface $record)
 {
     if ($record->hasFields('id')) {
         // check whether project exists
         if (isset($record->url)) {
             $type = TypeAbstract::getType($record->type);
             if (!$type->hasProject($record->url)) {
                 throw new Exception('Project doesnt exist');
             }
         }
         $con = new Condition(array('id', '=', $record->id));
         $this->table->update($record->getData(), $con);
         $this->notify(RecordAbstract::UPDATE, $record);
         return $record;
     } else {
         throw new Exception('Missing field in record');
     }
 }