Save annotation

@param int $idNote
@param string $note
@param string $starred
@param array $optional
@return bool|object
@throws InvalidRequestException
12592
public function saveAnnotation($idNote, $note = '', $starred = '', array $optional = [])
    {
        return $this->_request('Annotations.save', [
            'idNote' => $idNote,
            'note' => $note,
            'starred' => $starred,
        ], $optional);
    }
753982
def note(id, type, options = {})
      # Welguisz:  No idea why this is here, but keeping it here because it follows other blocks
      _notes
      # Create a new note and place it in the notes 2-D Hash
      @_notes[id][type] = Note.new(id, type, options)
    end
717831
def note(id, type, feature)
      _notes
      @_notes[id][type] = RSS_Note.new(id, type, feature)
    end
352198
public function markAs($id, $status, $user_id, $comment = null) {
        $this->id = $id;

        return $this->save(array(
            'status' => $status,
            'resolver_id' => $user_id,
            'comment' => $comment
        ));
    }
381559
public function summernote($instance = 'default', $selector = '.summenote', $parameters = array('width' => 900, 'height' => 450, 'title' => 'elFinder 2.0'))
    {
        if (!is_string($instance)) {
            throw new \Twig_Error_Runtime('The function can be applied to strings only.');
        }

        return $this->twig->render('@FMElfinder/Elfinder/helper/_summernote.html.twig',
            array(
                'instance' => $instance,
                'selector' => $selector,
                'width'    => $parameters['width'],
                'height'   => $parameters['height'],
                'title'    => $parameters['title'],
            ));
    }
1015325
public function save($entity, $options = [])
    {
        if ($this->link() !== static::LINK_KEY) {
            return true;
        }

        $name = $this->name();
        if (!isset($entity->{$name})) {
            return true;
        }
        $related = $entity->{$name};
        $result = $related->save($options);

        $keys = $this->keys();
        $from = key($keys);
        $to = current($keys);

        $conditions = [];
        if (!isset($related->{$to})) {
            throw new ORMException("The `'{$to}'` key is missing from related data.");
        }
        $conditions[$from] = $related->{$to};

        $entity->set($conditions);
        return $result;
    }
1239030
def save(self, notes=None):
        ''''''
        # Capture the notes if given
        if notes:
            self._changes['notes'] = notes

        # Call the base-class save function
        super(Issue, self).save()
813120
public function save(array $options = array())
  {
      // Do some testing before passing onto parent save method
      //if($this->category === null || $this->category->exists === false)
      //{
          //throw new DomainException('Post must be assigned a Category');
      //}

      if(!$this->exists)
      {
        $this->recordEvents(new PostWasCreatedEvent($this));
      }

      $saved = parent::save($options);

      return $saved;
  }
240140
private function readNote()
    {
//        echo '<b>Read Cell Annotation</b><br />';
        $length = self::getInt2d($this->data, $this->pos + 2);
        $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);

        // move stream pointer to next record
        $this->pos += 4 + $length;

        if ($this->readDataOnly) {
            return;
        }

        $cellAddress = $this->readBIFF8CellAddress(substr($recordData, 0, 4));
        if ($this->version == self::XLS_BIFF8) {
            $noteObjID = self::getInt2d($recordData, 6);
            $noteAuthor = self::readUnicodeStringLong(substr($recordData, 8));
            $noteAuthor = $noteAuthor['value'];
//            echo 'Note Address=', $cellAddress,'<br />';
//            echo 'Note Object ID=', $noteObjID,'<br />';
//            echo 'Note Author=', $noteAuthor,'<hr />';
//
            $this->cellNotes[$noteObjID] = array(
                'cellRef'   => $cellAddress,
                'objectID'  => $noteObjID,
                'author'    => $noteAuthor
            );
        } else {
            $extension = false;
            if ($cellAddress == '$B$65536') {
                //    If the address row is -1 and the column is 0, (which translates as $B$65536) then this is a continuation
                //        note from the previous cell annotation. We're not yet handling this, so annotations longer than the
                //        max 2048 bytes will probably throw a wobbly.
                $row = self::getInt2d($recordData, 0);
                $extension = true;
                $cellAddress = array_pop(array_keys($this->phpSheet->getComments()));
            }
//            echo 'Note Address=', $cellAddress,'<br />';

            $cellAddress = str_replace('$', '', $cellAddress);
            $noteLength = self::getInt2d($recordData, 4);
            $noteText = trim(substr($recordData, 6));
//            echo 'Note Length=', $noteLength,'<br />';
//            echo 'Note Text=', $noteText,'<br />';

            if ($extension) {
                //    Concatenate this extension with the currently set comment for the cell
                $comment = $this->phpSheet->getComment($cellAddress);
                $commentText = $comment->getText()->getPlainText();
                $comment->setText($this->parseRichText($commentText.$noteText));
            } else {
                //    Set comment for the cell
                $this->phpSheet->getComment($cellAddress)->setText($this->parseRichText($noteText));
//                                                    ->setAuthor($author)
            }
        }

    }
90478
public void deleteAnnotation(final Annotation note) {
    if (search != null) {
      search.deleteAnnotation(note).addErrback(new PluginError());
    }
  }
639156
def save_note(self, note_text, patient_id,
                  document_type,
                  document_status='Unsigned', wrapped_in_rtf='N'):
        
        allowed_document_status = ['Unsigned', 'Final']
        if document_status not in ['Unsigned', 'Final']:
            raise ValueError('document_status was invalid. allowed values are %s' %
                             allowed_document_status)
        magic = self._magic_json(action=TouchWorksMagicConstants.ACTION_SAVE_NOTE,
                                 patient_id=patient_id,
                                 parameter1=note_text,
                                 parameter2=document_type,
                                 parameter3=document_status,
                                 parameter4=wrapped_in_rtf)
        response = self._http_request(TouchWorksEndPoints.MAGIC_JSON, data=magic)
        result = self._get_results_or_raise_if_magic_invalid(
            magic,
            response,
            TouchWorksMagicConstants.RESULT_SAVE_NOTE)
        return result
1229449
public function save($con = null)
    {
        if (!method_exists($this->getFullyQualifiedModel(), 'save')) {
            throw new ReadOnlyModelException('Cannot save objects on a read-only model');
        }
        if (null === $con) {
            $con = $this->getWriteConnection();
        }
        $con->transaction(function () use ($con) {
            /** @var $element ActiveRecordInterface */
            foreach ($this as $element) {
                $element->save($con);
            }
        });
    }
481558
public function getAddNoteAction(ServerRequestInterface $request, Tree $tree): ResponseInterface
    {
        $xref = $request->get('xref', '');

        $note = Note::getInstance($xref, $tree);

        if ($note === null) {
            throw new NoteNotFoundException();
        }

        $options = $this->noteOptions($note);

        $title = I18N::translate('Add %s to the clippings cart', $note->fullName());

        return $this->viewResponse('modules/clippings/add-options', [
            'options' => $options,
            'default' => key($options),
            'record'  => $note,
            'title'   => $title,
            'tree'    => $tree,
        ]);
    }
15212
def get_note_attachment(id)
    login! unless logged_in?
    json = <<-EOF
      {
        "session": "#{@sugar_session_id}",
        "id": "#{id}"
      }
    EOF
    json.gsub!(/^\s{6}/,'')
    send!(:get_note_attachment, json)["note_attachment"]
  end
1314701
public function addNote(Note $note)
    {
        $this->connection()->post($this->endpoint . '/' . $this->id . '/notes',
            $note->jsonWithNamespace()
        );

        return $this;
    }
861217
public function getDeleteNote(int $character_id, int $note_id)
    {

        CharacterInfo::deleteNote($character_id, $note_id);

        return redirect()->back()
            ->with('success', 'Note deleted!');

    }
1075048
protected function persistEntity(EntityInterface $entity, array $data, array $options = []) : ?Response
    {
        $table = $this->loadModel();
        Assert::isInstanceOf($table, Table::class);

        $options = array_merge($options, ['lookup' => true]);
        $entity = $table->patchEntity($entity, $data, $options);

        $saved = false;
        try {
            $saved = $table->save($entity);
        } catch (PDOException $e) {
            Log::error($e->getMessage());
        }

        if ($entity->getErrors()) {
            Log::warning((string)json_encode($entity->getErrors()));
        }

        if (! $saved) {
            $this->Flash->error((string)__('The record could not be saved, please try again.'));
        }

        if ($saved) {
            $this->Flash->success((string)__('The record has been saved.'));

            $primaryKey = $table->getPrimaryKey();
            if (! is_string($primaryKey)) {
                throw new UnsupportedPrimaryKeyException();
            }

            // handle file uploads if found in the request data
            $fileUpload = new FileUpload($table);
            $fileUpload->link(
                $entity->get($primaryKey),
                (array)$this->request->getData()
            );

            $url = [];
            if ($table instanceof Table) {
                $url = $table->getParentRedirectUrl($table, $entity);
            }
            $url = ! empty($url) ? $url : ['action' => 'view', $entity->get($primaryKey)];

            return $this->redirect($url);
        }

        return null;
    }