|
|||||||||||
|
|
OverloadingBoth method calls and member accesses can be overloaded via the __call, __get and __set methods. These methods will only be triggered when your object or inherited object doesn't contain the member or method you're trying to access. Member overloadingvoid __set ( string name, mixed value)void __get ( mixed name) Class members can be overloaded to run custom code defined in your class by defining these specially named methods. The $name parameter used is the name of the variable that should be set or retrieved. The __set() method's $value parameter specifies the value that the object should set set the $name. Method overloadingmixed __call ( string name, array arguments)Class methods can be overloaded to run custom code defined in your class by defining this specially named method. The $name parameter used is the name as the function name that was requested to be used. The arguments that were passed in the function will be defined as an array in the $arguments parameter. The value returned from the __call() method will be returned to the caller of the method.
| ||||||||||
|
|
|
Home :: Copyright :: Privacy :: Credits :: Get a free Linuxinfor Email Account Document on this page is part of "PHP Handbuch". See Index Page for more info about Authorship and Copyright. 1999-2009 Linuxinfor.com. No rights reserved. |