mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
parent
ddce6c2210
commit
2e49064341
@ -3506,18 +3506,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user