mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-11-16 12:35:31 +00:00
38 lines
719 B
PHP
38 lines
719 B
PHP
<?php
|
|
namespace Wikia\PortableInfobox\Parser\Nodes;
|
|
|
|
class NodeComparison extends Node {
|
|
|
|
public function getData() {
|
|
if ( !isset( $this->data ) ) {
|
|
$this->data = [ 'value' => $this->getDataForChildren() ];
|
|
}
|
|
|
|
return $this->data;
|
|
}
|
|
|
|
public function getRenderData() {
|
|
return [
|
|
'type' => $this->getType(),
|
|
'data' => [ 'value' => $this->getRenderDataForChildren() ],
|
|
'isEmpty' => $this->isEmpty(),
|
|
'source' => $this->getSource()
|
|
];
|
|
}
|
|
|
|
public function isEmpty() {
|
|
/** @var Node $child */
|
|
foreach ( $this->getChildNodes() as $child ) {
|
|
if ( !$child->isEmpty() ) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
public function getSource() {
|
|
return $this->getSourceForChildren();
|
|
}
|
|
}
|