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.
|
string |
getClass
()
Returns the name of the class of this object.
|
ReflectionObject |
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 134 extensionMethodpublic static mixed extensionMethod (string $name, [mixed $callback = Adding method to class.
|
|||||||||||||||||||||
line 77 getClasspublic string getClass () Returns the name of the class of this object.
|
|||||||||||||||||||||
line 89 getReflectionpublic ReflectionObject getReflection () Access to reflection.
|
|||||||||||||||||||||
line 104 __callpublic mixed __call (string $name, array $args) Call to undefined method. Overridden in child classes as:
|
|||||||||||||||||||||
line 119 __callStaticpublic static mixed __callStatic (string $name, array $args) Call to undefined static method.
|
|||||||||||||||||||||
line 153 __getpublic mixed & __get (string $name) Returns property value. Do not call directly. Overridden in child classes as:
|
|||||||||||||||||||||
line 181 __issetpublic bool __isset (string $name) Is property defined? Overridden in child classes as:
|
|||||||||||||||||||||
line 168 __setpublic void __set (string $name, mixed $value) Sets value of a property. Do not call directly. Overridden in child classes as:
|
|||||||||||||||||||||
line 195 __unsetpublic void __unset (string $name) Access to undeclared property. Overridden in child classes as:
|