CMSObject deprecated
class CMSObject extends stdClass
deprecated 4.3 will be removed in 6.0 Use \stdClass or \Joomla\Registry\Registry instead. Example: new \Joomla\Registry\Registry();
Joomla Platform Object Class
This class allows for simple but smart objects with get and set methods and an internal error handler.
Traits
Trait which contains the legacy methods that formerly were inherited from \Joomla\CMS\Object\CMSObject to set and get errors in a class.
Trait which contains the legacy methods that formerly were inherited from \Joomla\CMS\Object\CMSObject to set and get properties of the current class.
Properties
protected array
deprecated
Since: 1.7.0
|
$_errors | An array of error messages or Exception objects. |
from LegacyErrorHandlingTrait |
Methods
Sets a default value if not already assigned
Returns a property of the object or the default value if the property is not set.
Modifies a property of the object, creating it if it does not already exist.
Class constructor, overridden in descendant classes.
Details
string
getError(int $i = null, bool $toString = true)
deprecated
deprecated 3.1.4 will be removed in 6.0 Will be removed without replacement Catch thrown Exceptions instead of getError
Get the most recent error message.
array
getErrors()
deprecated
deprecated 3.1.4 will be removed in 6.0 Will be removed without replacement Catch thrown Exceptions instead of getErrors
Return all errors, if any.
void
setError(string $error)
deprecated
deprecated 3.1.4 will be removed in 6.0 Will be removed without replacement Throw an Exception instead of using setError
Add an error message.
mixed
def(string $property, mixed $default = null)
deprecated
deprecated 4.3.0 will be removed in 6.0 Defining dynamic properties should not be used anymore
Sets a default value if not already assigned
mixed
get(string $property, mixed $default = null)
deprecated
deprecated 4.3.0 will be removed in 6.0 Create a proper getter function for the property
Returns a property of the object or the default value if the property is not set.
array
getProperties(bool $public = true)
deprecated
deprecated 4.3.0 will be removed in 6.0 Create a proper getter function for the property
Returns an associative array of object properties.
mixed
set(string $property, mixed $value = null)
deprecated
deprecated 4.3.0 will be removed in 6.0 Create a proper setter function for the property
Modifies a property of the object, creating it if it does not already exist.
bool
setProperties(mixed $properties)
deprecated
deprecated 4.3.0 will be removed in 6.0 Create a proper setter function for the property
Set the object properties based on a named array/hash.