mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-11-16 20:57:19 +00:00
36 lines
673 B
PHP
36 lines
673 B
PHP
<?php
|
|
namespace Wikia\PortableInfobox\Parser\Nodes;
|
|
|
|
class NodeGroup 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() ],
|
|
];
|
|
}
|
|
|
|
public function isEmpty() {
|
|
/** @var Node $item */
|
|
foreach ( $this->getChildNodes() as $item ) {
|
|
if ( !$item->isType( 'header' ) && !$item->isEmpty() ) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
public function getSource() {
|
|
return $this->getSourceForChildren();
|
|
}
|
|
}
|