示例#1
0
 /**
  * Returns true if the given method/parameter has a value
  * (Uses the DBField::hasValue if the parameter is a database field)
  * 
  * @param string $field The field name
  * @param array $arguments
  * @param bool $cache
  * @return boolean
  */
 function hasValue($field, $arguments = null, $cache = true)
 {
     $obj = $this->dbObject($field);
     if ($obj) {
         return $obj->exists();
     } else {
         return parent::hasValue($field, $arguments, $cache);
     }
 }
 /**
  * Returns true if the given method/parameter has a value
  * (Uses the DBField::hasValue if the parameter is a database field)
  *
  * @param string $field The field name
  * @param array $arguments
  * @param bool $cache
  * @return boolean
  */
 public function hasValue($field, $arguments = null, $cache = true)
 {
     // has_one fields should not use dbObject to check if a value is given
     if (!$this->has_one($field) && ($obj = $this->dbObject($field))) {
         return $obj->exists();
     } else {
         return parent::hasValue($field, $arguments, $cache);
     }
 }