BUGFIX DataObject::hasValue() is now compatible with parent ViewableData::hasValue() (this also fixes E_STRICT standards in PHP) (from r100921)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@111541 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2010-10-04 04:21:06 +00:00
parent ddce6c2210
commit 2e49064341

View File

@ -3506,18 +3506,19 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
/** /**
* Returns true if the given method/parameter has a value * Returns true if the given method/parameter has a value
* (Uses the DBField::hasValue if the parameter is a database field) * (Uses the DBField::hasValue if the parameter is a database field)
* @param string $funcName The function name. *
* @param array $args The arguments. * @param string $field The field name
* @param array $arguments
* @param bool $cache
* @return boolean * @return boolean
*/ */
function hasValue($funcName, $args = null) { function hasValue($field, $arguments = null, $cache = true) {
$field = $this->dbObject($funcName); $obj = $this->dbObject($field);
if ( $field ) { if($obj) {
return $field->hasValue(); return $obj->hasValue();
} else { } else {
return parent::hasValue($funcName, $args); return parent::hasValue($field, $arguments, $cache);
} }
} }
}
?> }