src/MocaBonita.php
public function setMbEvent(MbEvent $mbEvent, $dispatch)
    {
        if (is_array($dispatch)) {
            foreach ($dispatch as $event) {
                $this->setMbEvent($mbEvent, $event);
            }
        } else {
            if (!$this->mbEvents->has($dispatch)) {
                $this->mbEvents->put($dispatch, new Collection());
            }

            $this->mbEvents->get($dispatch)->push($mbEvent);
        }

        return $this;
    }
public function setMbEvent(MbEvent $mbEvent, $dispatch)
    {
        if (is_array($dispatch)) {
            foreach ($dispatch as $event) {
                $this->setMbEvent($mbEvent, $event);
            }
        } else {
            if (!$this->mbEvents->has($dispatch)) {
                $this->mbEvents->put($dispatch, new Collection());
            }

            $this->mbEvents->get($dispatch)->push($mbEvent);
        }

        return $this;
    }
public function setMbEvent ( MbEvent $ mbEvent , $ dispatch ) { if ( is_array ( $ dispatch ) ) { foreach ( $ dispatch as $ event ) { $ this -> setMbEvent ( $ mbEvent , $ event ) ; } } else { if ( ! $ this -> mbEvents -> has ( $ dispatch ) ) { $ this -> mbEvents -> put ( $ dispatch , new Collection ( ) ) ; } $ this -> mbEvents -> get ( $ dispatch ) -> push ( $ mbEvent ) ; } return $ this ; }
Set a MbEvent to a dispatcher type

@param MbEvent      $mbEvent
@param string|array $dispatch name of dispatcher

@return MocaBonita current instance of MocaBonita
Set a MbEvent to a dispatcher type