Example #1
0
 /**
  * Update a note in the database
  *
  * @param $uuid
  * @param $params
  * @return mixed
  */
 public function update($uuid, $params)
 {
     $note = $this->noteRepository->findByUuid($uuid);
     foreach ($params as $key => &$param) {
         if ($key == 'type') {
             $param = constant('Knoters\\Models\\NoteType::' . strtoupper($param));
         } else {
             if ($key == 'items') {
                 $this->saveNoteItems($note->id, $param);
                 unset($params['items']);
             }
         }
     }
     return $this->noteRepository->update($note->id, $params);
 }