Beispiel #1
0
 /**
  * makeCriteria 
  * 
  * @param mixed $data 
  * @access public
  * @return void
  */
 function makeCriteria($data)
 {
     $return = array();
     if (!(isset($data) && is_array($data))) {
         return false;
     }
     foreach ($data as $key => $value) {
         $crit_method1 = 'makeCriteria' . ucfirst($key);
         $crit_method2 = 'makeCriteria' . AMP::camelcase($key);
         $crit_method = method_exists($this, $crit_method1) ? $crit_method1 : $crit_method2;
         if (method_exists($this, $crit_method)) {
             $return[$key] = $this->{$crit_method}($value);
             continue;
         }
         if ($crit_method = $this->_getCriteriaMethod($key, $value)) {
             $return[$key] = $this->{$crit_method}($key, $value);
         }
     }
     return array_filter($return);
 }