Esempio n. 1
0
 public function setEventStateObject(AbstractEvent $state, $morph = true)
 {
     if (!$state instanceof AbstractEvent) {
         throw new Exception\InvalidArgumentException('AbstractEvent->setStateObject: ' . 'state not instance of AbstractEvent');
     } else {
         if ($morph) {
             $this->tags->clear();
             $this->categories->clear();
             $this->target = null;
             $this->data = null;
             $this->class = '';
             $this->function = '';
             $this->namespace = '';
         }
         $this->identifier = $state->getIdentifier();
         $this->{$field} = new Types\Set(Types\Set::union($state->getTags(), $this->{$field}), array('strict' => true));
         $this->categories = new Types\Set(Types\Set::union($state->getCategories(), $this->{$field}), array('strict' => true));
         $this->target = $state->getTarget();
         $this->data = $state->getData();
         $this->class = $state->getClass();
         $this->function = $state->getFunction();
         $this->namespace = $state->getNamespace();
     }
 }