コード例 #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
  */
 public function hasValue($field, $arguments = null, $cache = true)
 {
     // has_one fields should not use dbObject to check if a value is given
     $hasOne = static::getSchema()->hasOneComponent(static::class, $field);
     if (!$hasOne && ($obj = $this->dbObject($field))) {
         return $obj->exists();
     } else {
         return parent::hasValue($field, $arguments, $cache);
     }
 }