public function fireEvent($event, $entity, $halt = true)
    {
        /*if ($entity instanceof Wrapper) {
            throw new InvalidArgumentException('Fired Event with invalid Entity Object');
        }*/

        $eventName = "analogue.{$event}.".$this->entityMap->getClass();

        $method = $halt ? 'until' : 'fire';

        if (!array_key_exists($event, $this->events)) {
            throw new \LogicException("Analogue : Event $event doesn't exist");
        }

        $eventClass = $this->events[$event];
        $event = new $eventClass($entity);

        return $this->dispatcher->$method($eventName, $event);
    }
public function fireEvent($event, $entity, $halt = true)
    {
        /*if ($entity instanceof Wrapper) {
            throw new InvalidArgumentException('Fired Event with invalid Entity Object');
        }*/

        $eventName = "analogue.{$event}.".$this->entityMap->getClass();

        $method = $halt ? 'until' : 'fire';

        if (!array_key_exists($event, $this->events)) {
            throw new \LogicException("Analogue : Event $event doesn't exist");
        }

        $eventClass = $this->events[$event];
        $event = new $eventClass($entity);

        return $this->dispatcher->$method($eventName, $event);
    }
public function fireEvent ( $ event , $ entity , $ halt = true ) { /*if ($entity instanceof Wrapper) {
            throw new InvalidArgumentException('Fired Event with invalid Entity Object');
        }*/ $ eventName = "analogue.{$event}." . $ this -> entityMap -> getClass ( ) ; $ method = $ halt ? 'until' : 'fire' ; if ( ! array_key_exists ( $ event , $ this -> events ) ) { throw new \ LogicException ( "Analogue : Event $event doesn't exist" ) ; } $ eventClass = $ this -> events [ $ event ] ; $ event = new $ eventClass ( $ entity ) ; return $ this -> dispatcher -> $ method ( $ eventName , $ event ) ; }
Fire the given event for the entity.

@param string               $event
@param \Analogue\ORM\Entity $entity
@param bool                 $halt

@throws InvalidArgumentException

@return mixed
Fire the given event for the entity .