2015-04-27 14:05:31 +00:00
|
|
|
<?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 );
|
|
|
|
}
|
2015-05-26 10:51:41 +00:00
|
|
|
return [ 'value' => $nodeFactory->getDataFromNodes( $this->xmlNode, $this ) ];
|
2015-04-27 14:05:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function isEmpty( $data ) {
|
2015-05-07 12:37:13 +00:00
|
|
|
foreach ( $data[ 'value' ] as $elem ) {
|
|
|
|
if ( $elem[ 'type' ] != 'header' && !( $elem[ 'isEmpty' ] ) ) {
|
2015-04-27 14:05:31 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|