2019-02-24 22:03:04 +00:00
|
|
|
<?php
|
2022-03-11 20:35:51 +00:00
|
|
|
|
2019-02-24 22:03:04 +00:00
|
|
|
namespace PortableInfobox\Parser\Nodes;
|
|
|
|
|
|
|
|
class NodeSection extends Node {
|
|
|
|
public function getData() {
|
|
|
|
if ( !isset( $this->data ) ) {
|
|
|
|
$this->data = [
|
|
|
|
'label' => $this->getInnerValue( $this->xmlNode->{self::LABEL_TAG_NAME} ),
|
|
|
|
'value' => $this->getRenderDataForChildren(),
|
|
|
|
'item-name' => $this->getItemName(),
|
|
|
|
];
|
|
|
|
}
|
|
|
|
return $this->data;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function getChildNodes() {
|
|
|
|
if ( !isset( $this->children ) ) {
|
|
|
|
$this->children = [];
|
|
|
|
foreach ( $this->xmlNode as $child ) {
|
|
|
|
if ( !in_array( $child->getName(), [ 'section', 'panel', 'label' ] ) ) {
|
|
|
|
$this->children[] = NodeFactory::newFromSimpleXml( $child, $this->infoboxData )
|
|
|
|
->setExternalParser( $this->externalParser );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $this->children;
|
|
|
|
}
|
|
|
|
}
|