mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-11-16 20:57:19 +00:00
27 lines
596 B
PHP
27 lines
596 B
PHP
|
<?php
|
||
|
namespace Wikia\PortableInfobox\Parser\Nodes;
|
||
|
|
||
|
use Wikia\PortableInfobox\Parser\XmlParser;
|
||
|
|
||
|
class NodeSet extends Node {
|
||
|
|
||
|
public function getData() {
|
||
|
$nodeFactory = new XmlParser( $this->infoboxData );
|
||
|
if ( $this->externalParser ) {
|
||
|
$nodeFactory->setExternalParser( $this->externalParser );
|
||
|
}
|
||
|
$data = [];
|
||
|
$data['value'] = $nodeFactory->getDataFromNodes( $this->xmlNode );
|
||
|
return $data;
|
||
|
}
|
||
|
|
||
|
public function isEmpty( $data ) {
|
||
|
foreach ( $data['value'] as $elem ) {
|
||
|
if ( $elem['type'] != 'header' && !($elem['isEmpty']) ) {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
return true;
|
||
|
}
|
||
|
}
|