LMongo\Eloquent\Model::fireModelEvent PHP Method

fireModelEvent() protected method

Fire the given event for the model.
protected fireModelEvent ( string $event, boolean $halt = true ) : mixed
$event string
$halt boolean
return mixed
    protected function fireModelEvent($event, $halt = true)
    {
        if (!isset(static::$dispatcher)) {
            return true;
        }
        // We will append the names of the class to the event to distinguish it from
        // other model events that are fired, allowing us to listen on each model
        // event set individually instead of catching event for all the models.
        $event = "lmongo.{$event}: " . get_class($this);
        $method = $halt ? 'until' : 'fire';
        return static::$dispatcher->{$method}($event, $this);
    }
Model