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

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@100921 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2010-03-11 20:10:16 +00:00 committed by Sam Minnee
parent 2a583d9320
commit d4e565708c

View File

@ -3454,18 +3454,19 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
/**
* Returns true if the given method/parameter has a value
* (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
*/
function hasValue($funcName, $args = null) {
$field = $this->dbObject($funcName);
if ( $field ) {
return $field->hasValue();
function hasValue($field, $arguments = null, $cache = true) {
$obj = $this->dbObject($field);
if($obj) {
return $obj->hasValue();
} else {
return parent::hasValue($funcName, $args);
}
return parent::hasValue($field, $arguments, $cache);
}
}
?>
}