mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX: Allows DataObjectDecorators and other extensions to specify setters (setFoo) in the same manner as the already working Getters (getFoo).
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@74322 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
b65e2a3a82
commit
672d68a51d
@ -120,7 +120,7 @@ class ViewableData extends Object implements IteratorAggregate {
|
||||
* @param mixed $val The field value.
|
||||
*/
|
||||
public function __set($field, $val) {
|
||||
if(method_exists($this, $funcName = "set$field")) {
|
||||
if($this->hasMethod($funcName = "set$field")) {
|
||||
return $this->$funcName($val);
|
||||
} else {
|
||||
$this->setField($field, $val);
|
||||
|
Loading…
x
Reference in New Issue
Block a user