<?php
require_once 'VisitorInterface.php';
require_once 'OrganizationEntryAbstract.php';
class DumpVisitor implements VisitorInterface
{
public function visit(OrganizationEntryAbstract $entry)
{
if (get_class($entry) === 'Group') {
echo '■';
} else {
echo ' ';
}
echo $entry->getId() . ' : ' . $entry->getName() . '<br />';
foreach ($entry->getChildren() as $child) {
$child->accept($this);
}
}
}