예제 #1
0
 /**
  * Attach a handler to the session validator chain
  * 
  * @param  string $event
  * @param  callback $context 
  * @param  int $priority 
  * @return Zend\Stdlib\CallbackHandler
  */
 public function attach($event, $callback, $priority = 1)
 {
     $context = null;
     if ($callback instanceof Validator) {
         $context = $callback;
     } elseif (is_array($callback)) {
         $test = array_shift($callback);
         if ($test instanceof Validator) {
             $context = $test;
         }
         array_unshift($callback, $test);
     }
     if ($context instanceof Validator) {
         $data = $context->getData();
         $name = $context->getName();
         $this->getStorage()->setMetadata('_VALID', array($name => $data));
     }
     $handle = parent::connect($event, $callback, $priority);
     return $handle;
 }