Example #1
0
 public function visit(OrganizationEntry $entry)
 {
     if ($entry instanceof \DoYouPhp\PhpDesignPattern\Visitor\ConcreteElement\Group) {
         $this->group_count++;
     } else {
         $this->employee_count++;
     }
     foreach ($entry->getChildren() as $ent) {
         $this->visit($ent);
     }
 }
Example #2
0
 public function visit(OrganizationEntry $entry)
 {
     if ($entry instanceof \DoYouPhp\PhpDesignPattern\Visitor\ConcreteElement\Group) {
         echo '■';
     } else {
         echo '-->';
     }
     echo $entry->getCode() . ":" . $entry->getName() . PHP_EOL;
     foreach ($entry->getChildren() as $child) {
         $child->accept($this);
     }
 }
Example #3
0
File: Group.php Project: JJmaz/dp
 public function __construct($code, $name)
 {
     parent::__construct($code, $name);
     $this->entries = array();
 }
Example #4
0
 public function __construct($code, $name)
 {
     parent::__construct($code, $name);
 }