This class offers several useful methods that all derived classes can use. The
getPublicProperties() method returns an array of public property names from
the object. This is determined at run time and uses the object properties, not the
class properties.
The get() and set() methods are used to get and set properties of the object. If
we use get() with a nonexistent property, the default value will be returned. If we
use set() with a nonexistent property, the property will be created. Both of these
methods can be used with private properties.
We can keep track of errors that occur in an object using the getErrors(),
getError(), and setError() methods. Errors are recorded in the _errors array
property. Errors can be strings or JException or Exception objects. JException objects
are created when we raise errors; this is explained in detail in Chapter 11.
A full description of the JObject class is available in the Appendix.
Working with the Request
Generally when we develop PHP scripts, we work extensively with the request
hashes: $_GET, $_POST, $_FILES, $_COOKIE, and $_REQUEST.
Pages:
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50