Class Object (namespace Nette)
Nette\Object is the ultimate ancestor of all instantiable classes.
It defines some handful methods and enhances object core of PHP:
- access to undeclared members throws exceptions
- support for conventional properties with getters and setters
- support for event raising functionality
- ability to add new methods to class (extension methods)
Event functionality is provided by declaration of property named 'on{Something}' Multiple handlers are allowed.
Adding method to class (i.e. to all instances) works similar to JavaScript prototype property. The syntax for adding a new method is:
Direct Known Sub-classes:
Public Method Summary | |
---|---|
static mixed |
extensionMethod
(string $name, [mixed $callback =
NULL ])
Adding method to class.
|
void |
getClass
()
|
ClassReflection |
Access to reflection.
|
mixed |
__call
(string $name, array $args)
Call to undefined method.
|
static mixed |
__callStatic
(string $name, array $args)
Call to undefined static method.
|
& mixed |
__get
(string $name)
Returns property value. Do not call directly.
|
bool |
__isset
(string $name)
Is property defined?
|
void |
__set
(string $name, mixed $value)
Sets value of a property. Do not call directly.
|
void |
__unset
(string $name)
Access to undeclared property.
|
Method Details | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
line 121 extensionMethodpublic static mixed extensionMethod (string $name, [mixed $callback = Adding method to class.
|
|||||||||||||||||||||
line 63 getClasspublic void getClass ()
|
|||||||||||||||||||||
line 76 getReflectionpublic ClassReflection getReflection () Access to reflection. Overridden in child classes as:
|
|||||||||||||||||||||
line 91 __callpublic mixed __call (string $name, array $args) Call to undefined method. Overridden in child classes as:
|
|||||||||||||||||||||
line 106 __callStaticpublic static mixed __callStatic (string $name, array $args) Call to undefined static method.
|
|||||||||||||||||||||
line 145 __getpublic mixed & __get (string $name) Returns property value. Do not call directly. Overridden in child classes as:
|
|||||||||||||||||||||
line 173 __issetpublic bool __isset (string $name) Is property defined? Overridden in child classes as:
|
|||||||||||||||||||||
line 160 __setpublic void __set (string $name, mixed $value) Sets value of a property. Do not call directly. Overridden in child classes as:
|
|||||||||||||||||||||
line 187 __unsetpublic void __unset (string $name) Access to undeclared property. Overridden in child classes as:
|