Example #1
0
 /**
  * Validate the arguments specified for this Action.
  *
  * @throws \Teleport\Action\ActionException If required arguments are not specified.
  * @return bool TRUE if the arguments are valid, FALSE otherwise.
  */
 public function validate()
 {
     if (!empty($this->required)) {
         $invalid = array_diff($this->required, array_keys($this->request->args()));
         if (!empty($invalid)) {
             foreach ($invalid as $argKey) {
                 $this->request->addResult("{$argKey} required for this request.");
             }
             throw new ActionException($this, "Required arguments " . implode(', ', $invalid) . " not specified.");
         }
     }
 }