2015-04-27 14:05:31 +00:00
|
|
|
<?php
|
|
|
|
namespace Wikia\PortableInfobox\Parser\Nodes;
|
|
|
|
|
|
|
|
use Wikia\PortableInfobox\Parser\XmlParser;
|
|
|
|
|
2015-05-07 12:37:13 +00:00
|
|
|
class NodeComparison extends Node {
|
2015-04-27 14:05:31 +00:00
|
|
|
|
|
|
|
public function getData() {
|
2015-06-10 09:28:33 +00:00
|
|
|
if ( !isset( $this->data ) ) {
|
|
|
|
$nodeFactory = new XmlParser( $this->infoboxData );
|
|
|
|
if ( $this->externalParser ) {
|
|
|
|
$nodeFactory->setExternalParser( $this->externalParser );
|
|
|
|
}
|
|
|
|
$this->data = [ 'value' => $nodeFactory->getDataFromNodes( $this->xmlNode, $this ) ];
|
2015-04-27 14:05:31 +00:00
|
|
|
}
|
2015-06-10 09:28:33 +00:00
|
|
|
|
|
|
|
return $this->data;
|
2015-04-27 14:05:31 +00:00
|
|
|
}
|
|
|
|
|
2015-06-10 09:28:33 +00:00
|
|
|
public function isEmpty() {
|
|
|
|
$data = $this->getData();
|
2015-05-07 12:37:13 +00:00
|
|
|
foreach ( $data[ 'value' ] as $group ) {
|
|
|
|
if ( $group[ 'isEmpty' ] == false ) {
|
2015-04-27 14:05:31 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2015-06-10 09:28:33 +00:00
|
|
|
|
2015-04-27 14:05:31 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|