public function _init($proto, $class = null) 
    {
      $this->active = false;
      $this->model = $class;
      $cons = $proto[0]->get();	
      $args = $proto[1]->get();
      /** make sure our constraints match **/

      foreach ($cons as $k => $v) {
        /** 
         * one constraint does not match
         * when this happens we need
         * to revoke the event
         *
         * i.e
         * MessageEvent(array("direction" => "incoming"))
         *
         * should not accept outgoing
         */
        if (isset($args[$k]) 
           && $args[$k] !== $v) {
          return;
        }
      }

      /**
       * now that our constraints match
       * make sure 'eventType' is this classes
       * type. 
       */

      if (!($this->isInvoked($args))) {
        return;
      }

      /** set the variables **/

      foreach ($args as $k => $v) {
        $this->$k = $v;
      }

      /**
       * TODO move
       *
       * as of now model will not autmatically
       * be made.
       */
      //$this->model->id = $args['id'];
      //$this->model->get();
    }
public function _init($proto, $class = null) 
    {
      $this->active = false;
      $this->model = $class;
      $cons = $proto[0]->get();	
      $args = $proto[1]->get();
      /** make sure our constraints match **/

      foreach ($cons as $k => $v) {
        /** 
         * one constraint does not match
         * when this happens we need
         * to revoke the event
         *
         * i.e
         * MessageEvent(array("direction" => "incoming"))
         *
         * should not accept outgoing
         */
        if (isset($args[$k]) 
           && $args[$k] !== $v) {
          return;
        }
      }

      /**
       * now that our constraints match
       * make sure 'eventType' is this classes
       * type. 
       */

      if (!($this->isInvoked($args))) {
        return;
      }

      /** set the variables **/

      foreach ($args as $k => $v) {
        $this->$k = $v;
      }

      /**
       * TODO move
       *
       * as of now model will not autmatically
       * be made.
       */
      //$this->model->id = $args['id'];
      //$this->model->get();
    }
public function _init ( $ proto , $ class = null ) { $ this -> active = false ; $ this -> model = $ class ; $ cons = $ proto [ 0 ] -> get ( ) ; $ args = $ proto [ 1 ] -> get ( ) ; /** make sure our constraints match **/ foreach ( $ cons as $ k => $ v ) { /** 
         * one constraint does not match
         * when this happens we need
         * to revoke the event
         *
         * i.e
         * MessageEvent(array("direction" => "incoming"))
         *
         * should not accept outgoing
         */ if ( isset ( $ args [ $ k ] ) && $ args [ $ k ] !== $ v ) { return ; } } /**
       * now that our constraints match
       * make sure 'eventType' is this classes
       * type. 
       */ if ( ! ( $ this -> isInvoked ( $ args ) ) ) { return ; } /** set the variables **/ foreach ( $ args as $ k => $ v ) { $ this -> $ k = $ v ; } /**
       * TODO move
       *
       * as of now model will not autmatically
       * be made.
       */ //$this->model->id = $args['id']; //$this->model->get(); }
_init will register things
used by this event object

@param proto: EnsuredInput. needs to be two arity
@param class: Intiated model class
_init will register things used by this event object