mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Hack to fix Fatal error: Call to undefined method stdClass::allMethodNames() (merged from 2.0.2 branch, r42505)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@42921 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
bd81e2a2be
commit
70db5d36a0
@ -200,11 +200,14 @@ class Object {
|
||||
protected function addMethodsFrom($parameterName, $arrayIndex = null) {
|
||||
$obj = isset($arrayIndex) ? $this->{$parameterName}[$arrayIndex] : $this->$parameterName;
|
||||
if(!$obj) user_error("Object::addMethodsFrom: $parameterName/$arrayIndex", E_USER_ERROR);
|
||||
// Hack to fix Fatal error: Call to undefined method stdClass::allMethodNames()
|
||||
if(method_exists($obj, 'allMethodNames')) {
|
||||
$methodNames = $obj->allMethodNames(true);
|
||||
foreach($methodNames as $methodName) {
|
||||
Object::$extraMethods[$this->class][$methodName] = array("parameterName" => $parameterName, "arrayIndex" => $arrayIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a 'wrapper method'.
|
||||
|
Loading…
x
Reference in New Issue
Block a user