Pop\Pdf\Pdf::getContentObject PHP Method

getContentObject() protected method

Method to return the current page's content object, or create one if necessary.
protected getContentObject ( ) : integer
return integer
    protected function getContentObject()
    {
        // If the page's current content object index is not set, create one.
        if (null === $this->objects[$this->objects[$this->pages[$this->curPage]]->index]->curContent) {
            $coi = $this->lastIndex($this->objects) + 1;
            $this->objects[$this->objects[$this->pages[$this->curPage]]->index]->content[] = $coi;
            $this->objects[$this->objects[$this->pages[$this->curPage]]->index]->curContent = $coi;
            $this->objects[$coi] = new Object\Object($coi);
            // Else, set and return the page's current content object index.
        } else {
            $coi = $this->objects[$this->objects[$this->pages[$this->curPage]]->index]->curContent;
        }
        return $coi;
    }