Example #1
0
 private function getCaughtEventsCount($listener, $event)
 {
     $count = 0;
     if ($this->caught->has($listener)) {
         foreach ($this->caught->get($listener) as $caughtEvent) {
             if (get_class($caughtEvent) == $event) {
                 $count++;
             }
         }
     }
     return $count;
 }
Example #2
0
 private function accumulate(Map $acc, BaseProperty $property)
 {
     if (!$acc->has($property->name())) {
         $acc->set($property->name(), $property);
     } else {
         $multi = $acc->get($property->name());
         if (!$multi instanceof property\MultiProperty) {
             $multi = new property\MultiProperty($this->factory, $property);
             $multi->add($acc->get($property->name()));
             $acc->set($property->name(), $multi);
         }
         $multi->add($property);
     }
 }