protected function convertToScalarImpl(Aggregator $aggregator)
 {
     /* @var $aggregator NodeAggregator  */
     return ['own' => $this->aggregatorPresenter->convertToScalar($aggregator->getActualAggregator()), 'children' => array_map(function (Aggregator $childAggregator) {
         return $this->aggregatorPresenter->convertToScalar($childAggregator);
     }, $aggregator->getChildren())];
 }
 public function visit(Aggregator $a)
 {
     if (!$a instanceof \lukaszmakuch\Aggregator\LabelGenerator\WithCustomLabel) {
         throw new \lukaszmakuch\Aggregator\XmlPresenter\Exception\UnableToCreateXml();
     }
     $xmlDoc = new \DOMDocument();
     $xmlDoc->loadXML($a->getActualAggregator()->accept($this->presenterOfEveryAggregator));
     $xmlDoc->documentElement->setAttribute("label", $a->getLabel());
     return $xmlDoc->saveXML();
 }
 protected function convertToScalarImpl(Aggregator $aggregator)
 {
     /* @var $aggregator AggregatorOfSubjectsWithCommonProperties */
     return $this->presenterOfActualAggregators->convertToScalar($aggregator->getActualAggregator());
 }
 protected function convertToScalarImpl(Aggregator $aggregator)
 {
     /* @var $aggregator WithCustomLabel */
     return $this->presenterOfActualAggregators->convertToScalar($aggregator->getActualAggregator());
 }