dataObject = []; $this->docId = 0; $this->pageBundle = (object)[ "parsoid" => PHPUtils::arrayToObject( [ "counter" => -1, "ids" => [] ] ), "mw" => PHPUtils::arrayToObject( [ "ids" => [] ] ) ]; } /** * Return this document's pagebundle object * @return stdClass */ public function getPageBundle(): stdClass { return $this->pageBundle; } /** * Get the data object for the node with data-object-id 'docId'. * This will return null if a non-existent docId is provided. * * @param int $docId * @return stdClass|null */ public function getObject( int $docId ): ?stdClass { return $this->dataObject[$docId] ?? null; } /** * Stash the data and return an id for retrieving it later * @param stdClass $data * @return int */ public function stashObject( stdClass $data ): int { $docId = $this->docId++; $this->dataObject[$docId] = $data; return $docId; } }