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