class JObject


Located at : UKNOWVA_ROOT/libraries/joomla/base/object.php

Base object class.

This class allows for simple but smart objects with get and set methods and an internal error handler.

Methods

__construct(mixed $properties = null)

Class constructor, overridden in descendant classes.

string
__toString()

Magic method to convert the object to a string gracefully.

mixed
def(string $property, mixed $default = null)

Sets a default value if not alreay assigned

mixed
get(string $property, mixed $default = null)

Returns a property of the object or the default value if the property is not set.

array
getProperties(boolean $public = true)

Returns an associative array of object properties.

string
getError(integer $i = null, boolean $toString = true)

Get the most recent error message.

array
getErrors()

Return all errors, if any.

mixed
set(string $property, mixed $value = null)

Modifies a property of the object, creating it if it does not already exist.

boolean
setProperties(mixed $properties)

Set the object properties based on a named array/hash.

void
setError(string $error)

Add an error message.

string
toString() deprecated

No description

Details

at line 42
JObject __construct(mixed $properties = null)

Class constructor, overridden in descendant classes.

Parameters

mixed $properties Either and associative array or another object to set the initial properties of the object.

Return Value

JObject

at line 56
string __toString()

Magic method to convert the object to a string gracefully.

Return Value

string The classname.

at line 70
mixed def(string $property, mixed $default = null)

Sets a default value if not alreay assigned

Parameters

string $property The name of the property.
mixed $default The default value.

Return Value

mixed

at line 88
mixed get(string $property, mixed $default = null)

Returns a property of the object or the default value if the property is not set.

Parameters

string $property The name of the property.
mixed $default The default value.

Return Value

mixed The value of the property.

See also

getProperties()

at line 107
array getProperties(boolean $public = true)

Returns an associative array of object properties.

Parameters

boolean $public If true, returns only the public properties.

Return Value

array

See also

get()

at line 133
string getError(integer $i = null, boolean $toString = true)

Get the most recent error message.

Parameters

integer $i Option error index.
boolean $toString Indicates if JError objects should return their error message.

Return Value

string Error message

at line 165
array getErrors()

Return all errors, if any.

Return Value

array Array of error messages or JErrors.

at line 180
mixed set(string $property, mixed $value = null)

Modifies a property of the object, creating it if it does not already exist.

Parameters

string $property The name of the property.
mixed $value The value of the property to set.

Return Value

mixed Previous value of the property.

at line 198
boolean setProperties(mixed $properties)

Set the object properties based on a named array/hash.

Parameters

mixed $properties Either an associative array or another object.

Return Value

boolean

See also

set()

at line 222
void setError(string $error)

Add an error message.

Parameters

string $error Error message.

Return Value

void

at line 235
string toString() deprecated

deprecated 12.1 Use magic method __toString()

Return Value

string

See also

__toString()