Get the first note attached to this media object

@return string
518776
public function getNote(): string
    {
        $fact = $this->facts(['NOTE'])->first();

        if ($fact instanceof Fact) {
            // Link to note object
            $note = $fact->target();
            if ($note instanceof Note) {
                return $note->getNote();
            }

            // Inline note
            return $fact->value();
        }

        return '';
    }
36364
public function first()
    {
        $this->rewind();
        $document = $this->getCursor()->current();

        if (!$document) {
            return;
        }

        return $this->getAssembler()->assemble($document, $this->entitySchema);
    }
697879
public function getFirst(){
        $res = ExecImpl::get($this->context);
        if(count($res)){
            return $res[0];
        }
        return null;
    }
876707
public function FirstLast()
    {
        if ($this->First() && $this->Last()) {
            return 'first last';
        }
        if ($this->First()) {
            return 'first';
        }
        if ($this->Last()) {
            return 'last';
        }
        return null;
    }
1367940
protected function displayNotes()
    {
        $notes = array();

        if ($this->note !== null) {
            $note = new SwatMessage($this->note);
            $note->content_type = $this->note_content_type;
            $notes[] = $note;
        }

        $control = $this->getFirstDescendant('SwatControl');
        if ($control !== null) {
            $note = $control->getNote();
            if ($note !== null) {
                $notes[] = $note;
            }
        }

        if (count($notes) === 1) {
            $note = reset($notes);
            $note_div = new SwatHtmlTag('div');
            $note_div->class = 'swat-note';
            $note_div->setContent($note->primary_content, $note->content_type);
            $note_div->display();
        } elseif (count($notes) > 1) {
            $note_list = new SwatHtmlTag('ul');
            $note_list->class = 'swat-note';
            $note_list->open();

            $li_tag = new SwatHtmlTag('li');
            foreach ($notes as $note) {
                $li_tag->setContent(
                    $note->primary_content,
                    $note->content_type
                );

                $li_tag->display();
            }

            $note_list->close();
        }
    }
968675
protected function firstLetter()
    {
        $string = trim((string) $this->getParameter('string'));
        $lower = (boolean) $this->getParameter('lower');
        return StringUtils::firstLetter($string, $lower);
    }
777885
public function getMediaOrder()
    {
        $header = $this->header();

        return isset($header->media_order) ? array_map('trim', explode(',', (string)$header->media_order)) : [];
    }
532456
public function FirstName()
    {
        $type = $this->getUpdateType();
        if ($type == self::CALLBACK_QUERY) {
            return @$this->data['callback_query']['from']['first_name'];
        }
        if ($type == self::CHANNEL_POST) {
            return @$this->data['channel_post']['from']['first_name'];
        }
        if ($type == self::EDITED_MESSAGE) {
            return @$this->data['edited_message']['from']['first_name'];
        }

        return @$this->data['message']['from']['first_name'];
    }
512237
public function goFirst(){
    //delete others unAndit nodes
    $this->deleteAllUnAuditResourceNodes();
    //get first user id, if haven't , point to me
    $userId = static::$app['auth']->user()->id;
    $resNode = $this->resourcenodes()->where('orders', '=', 0)->get()->first();
    if($resNode && $resNode->count() >0){
      $userId = $resNode->user_id;
    }
    $firstNode = new WorkFlowResourcenode();
    $firstNode->user_id = $userId;
    $firstNode->orders = 0;
    $this->resourcenodes()->save($firstNode);

    $this->node_orders = 0;
    $this->status = 'unstart';
    return $this->save();
  }
248964
public function getFirst()
    {
        $element = null;

        if (
            $this->hasParent() and
            $this->parent->hasElements()
        ) {
            $element = $this->parent->elements[0];
        }

        return $element;
    }
595836
public function getStart(): string
    {
        $str = '<' . $this->tag . ' ';
        foreach ($this->attrs as $key => $value) {
            $str .= $key . '="' . $value . '" ';
        }
        $str .= '>';

        return $str;
    }
559730
protected static function get_note_structure() {
        return array(
                     'id'           => new external_value(PARAM_INT, 'id of this note'),
                     'courseid'     => new external_value(PARAM_INT, 'id of the course'),
                     'userid'       => new external_value(PARAM_INT, 'user id'),
                     'content'      => new external_value(PARAM_RAW, 'the content text formated'),
                     'format'       => new external_format_value('content'),
                     'created'      => new external_value(PARAM_INT, 'time created (timestamp)'),
                     'lastmodified' => new external_value(PARAM_INT, 'time of last modification (timestamp)'),
                     'usermodified' => new external_value(PARAM_INT, 'user id of the creator of this note'),
                     'publishstate' => new external_value(PARAM_ALPHA, "state of the note (i.e. draft, public, site) ")
        );
    }
997037
protected function locatedEmbeddedMedia() {

		$embedded_media = get_media_embedded_in_content( $this->content );

		if ( $embedded_media ) {
			return $this->original_media = array_shift( $embedded_media );
		}

		return '';
	}
679780
public function firstImageFile(): ?MediaFile
    {
        foreach ($this->mediaFiles() as $media_file) {
            if ($media_file->isImage()) {
                return $media_file;
            }
        }

        return null;
    }
58571
private function getNotes()
    {
        $xpath = $this->reader->getXpath();

        $nodes = $xpath->query($this->reader->getRoot().'/cbc:Note');
        $notes = [];
        if ($nodes->length === 0) {
            return $notes;
        }

        /** @var \DOMElement $node */
        foreach ($nodes as $node) {
            $notes[] = $node->nodeValue;
        }

        return $notes;
    }
1156828
public function upperCaseFirst()
    {
        $first = UTF8::substr($this->scalarString, 0, 1, $this->encoding);

        $rest = UTF8::substr
        (
            $this->scalarString,
            1,
            $this->getLength() - 1,
            $this->encoding
        );

        return $this->newSelf(UTF8::strtoupper($first, $this->encoding).$rest);
    }
546005
public function getNotes()
    {
        $notes = [];
        if ($this->entity->getNotes()) {
            foreach ($this->entity->getNotes() as $note) {
                $notes[] = $note;
            }
        }

        return $notes;
    }