mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Use ClassInfo::hasMethod instead of method_exists()
This allows for setters to exist in extension instances.
This commit is contained in:
parent
1a4211f089
commit
c9cf7b1d75
@ -761,7 +761,7 @@ class Injector implements ContainerInterface
|
||||
*/
|
||||
protected function setObjectProperty($object, $name, $value)
|
||||
{
|
||||
if (method_exists($object, 'set'.$name)) {
|
||||
if (ClassInfo::hasMethod($object, 'set'.$name)) {
|
||||
$object->{'set'.$name}($value);
|
||||
} else {
|
||||
$object->$name = $value;
|
||||
|
Loading…
x
Reference in New Issue
Block a user