LegacyPropertyManagementTrait
Trait which contains the legacy methods that formerly were inherited from \Joomla\CMS\Object\CMSObject to set and get properties of the current class.
| since |
4.3.0 |
|---|---|
| deprecated |
4.3.0 will be removed in 6.0 Will be removed without replacement Create proper setter functions for the individual properties or use a \Joomla\Registry\Registry |
| package |
Joomla CMS |
Methods
def
Sets a default value if not already assigned
def( property, default = null) :
| since |
1.7.0 |
|---|---|
| deprecated |
4.3.0 will be removed in 6.0 Defining dynamic properties should not be used anymore |
Arguments
- property
stringThe name of the property.- default
mixedThe default value.
Response
mixed
get
Returns a property of the object or the default value if the property is not set.
get( property, default = null) :
| since |
1.7.0 |
|---|---|
| see | CMSObject::getProperties() |
| deprecated |
4.3.0 will be removed in 6.0 Create a proper getter function for the property |
Arguments
- property
stringThe name of the property.- default
mixedThe default value.
Response
mixedThe value of the property.
getProperties
Returns an associative array of object properties.
getProperties( public = true) : mixed||string|int
| since |
1.7.0 |
|---|---|
| see | CMSObject::get() |
| deprecated |
4.3.0 will be removed in 6.0 Create a proper getter function for the property |
Arguments
- public
boolIf true, returns only the public properties.
Response
array<string|int, mixed>
set
Modifies a property of the object, creating it if it does not already exist.
set( property, value = null) :
| since |
1.7.0 |
|---|---|
| deprecated |
4.3.0 will be removed in 6.0 Create a proper setter function for the property |
Arguments
- property
stringThe name of the property.- value
mixedThe value of the property to set.
Response
mixedPrevious value of the property.
setProperties
Set the object properties based on a named array/hash.
setProperties( properties) :
| since |
1.7.0 |
|---|---|
| see | CMSObject::set() |
| deprecated |
4.3.0 will be removed in 6.0 Create a proper setter function for the property |
Arguments
- properties
mixedEither an associative array or another object.
Response
bool