示例#1
0
文件: Rule.php 项目: fredcido/simuweb
 /**
  * 
  * @param App_General_Message $message
  * @param array $data
  * @param string $identifier
  */
 public function validate(App_General_Message $message, array $data, $identifier)
 {
     $this->_messageModel = $message;
     $this->_dataModel = $data;
     $rules = $this->listRules($identifier);
     foreach ($rules as $rule) {
         $method = '_validate' . App_General_String::toCamelCase($rule->rule, '_');
         if (method_exists($this, $method)) {
             call_user_func_array(array($this, $method), array($rule));
         }
     }
 }
示例#2
0
 /**
  *
  * @return mixed 
  */
 public function saveItens()
 {
     $method = 'save' . App_General_String::toCamelCase($this->_data['action']);
     return call_user_func(array($this, $method));
 }
示例#3
0
 /**
  *
  * @return string
  */
 protected function _getMethod()
 {
     $method = explode('/', $this->_data['path']);
     $method = lcfirst(App_General_String::toCamelCase($method[1]));
     return $method;
 }