ENHANCEMENT Allowing more arguments in Object->extend() (merged from branches/translatable in r64523, thanks wakeless!)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@69896 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-01-08 04:15:22 +00:00 committed by Sam Minnee
parent e07094adad
commit 941a9eb7bd

View File

@ -460,12 +460,15 @@ class Object {
* @param string $funcName The name of the function.
* @param mixed $arg An Argument to be passed to each of the extension functions.
*/
public function extend($funcName, &$arg=null) {
public function extend($funcName, &$arg1=null, &$arg2=null, &$arg3=null, &$arg4=null, &$arg5=null, &$arg6=null, &$arg7=null) {
$arguments = func_get_args();
array_shift($arguments);
if($this->extension_instances) {
$returnArr = array();
foreach($this->extension_instances as $extension) {
if($extension->hasMethod($funcName)) {
$return = $extension->$funcName($arg);
$return = $extension->$funcName($arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7);
if($return !== NULL) $returnArr[] = $return;
}
}