public function getNumberOfSiblings($node_name) { if (self::DEBUG) { u\DebugUtility::out("Node ID: " . $node_name); } $par_id = $this->node_map[$node_name]->getParentId(); if (self::DEBUG) { u\DebugUtility::out("Parent ID: " . $par_id); } if (!in_array($node_name, $this->identifiers)) { throw new e\NodeException(S_SPAN . "The node {$node_name} does not exist" . E_SPAN); } if ($par_id != '') { $siblings = $this->node_map[$par_id]->getChildren(); } else { $siblings = $this->children; } // remove ;0 $field_id = StructuredDataNode::removeLastIndex($node_name); if (self::DEBUG) { u\DebugUtility::out("Field ID: " . $field_id); } $last_sibling_index = StructuredDataNode::getPositionOfLastNode($siblings, $field_id); $last_id = $siblings[$last_sibling_index]->getIdentifier(); return StructuredDataNode::getLastIndex($last_id) + 1; }