JComponentRecord

Extends \JObject

Object representing a component extension record

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

since

3.7.0

note

As of 4.0 this class will no longer extend JObject

package

Joomla.Libraries

Methods

__construct

Class constructor, overridden in descendant classes.

__construct(mixed $properties = null) 
inherited
since

11.1

Arguments

$properties

mixedEither and associative array or another object to set the initial properties of the object.

__get

Method to get certain otherwise inaccessible properties from the form field object.

__get(string $name) : mixed
deprecated
since

3.7.0

deprecated

4.0 Access the item parameters through the getParams() method

Arguments

$name

stringThe property name for which to the the value.

Response

mixedThe property value or null.

__set

Method to set certain otherwise inaccessible properties of the form field object.

__set(string $name, mixed $value) : void
deprecated
since

3.7.0

deprecated

4.0 Set the item parameters through the setParams() method

Arguments

$name

stringThe property name for which to the the value.

$value

mixedThe value of the property.

__toString

Magic method to convert the object to a string gracefully.

__toString() : string
inherited deprecated
since

11.1

deprecated

12.3 Classes should provide their own __toString() implementation.

Response

stringThe classname.

def

Sets a default value if not already assigned

def(string $property, mixed $default = null) : mixed
inherited
since

11.1

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(string $property, mixed $default = null) : mixed
inherited
since

11.1

see \JObject::getProperties()

Arguments

$property

stringThe name of the property.

$default

mixedThe default value.

Response

mixedThe value of the property.

getError

Get the most recent error message.

getError(integer $i = null, boolean $toString = true) : string
inherited deprecated
since

11.1

see \JError
deprecated

12.3 JError has been deprecated

Arguments

$i

integerOption error index.

$toString

booleanIndicates if JError objects should return their error message.

Response

stringError message

getErrors

Return all errors, if any.

getErrors() : array
inherited deprecated
since

11.1

see \JError
deprecated

12.3 JError has been deprecated

Response

arrayArray of error messages or JErrors.

getParams

Returns the menu item parameters

getParams() : \Joomla\Registry\Registry
since

3.7.0

Response

\Joomla\Registry\Registry

getProperties

Returns an associative array of object properties.

getProperties(boolean $public = true) : array
inherited
since

11.1

see \JObject::get()

Arguments

$public

booleanIf true, returns only the public properties.

Response

array

set

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

set(string $property, mixed $value = null) : mixed
inherited
since

11.1

Arguments

$property

stringThe name of the property.

$value

mixedThe value of the property to set.

Response

mixedPrevious value of the property.

setError

Add an error message.

setError(string $error) : void
inherited deprecated
since

11.1

see \JError
deprecated

12.3 JError has been deprecated

Arguments

$error

stringError message.

setParams

Sets the menu item parameters

setParams(\Joomla\Registry\Registry|string $params) : void
since

3.7.0

Arguments

$params

\Joomla\Registry\Registry|stringThe data to be stored as the parameters

setProperties

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

setProperties(mixed $properties) : boolean
inherited
since

11.1

see \JObject::set()

Arguments

$properties

mixedEither an associative array or another object.

Response

boolean

Properties

id

Primary key

Type(s)

integer

option

The component name

Type(s)

integer

params

The component parameters

Type(s)

string|\Joomla\Registry\Registry

enabled

Indicates if this component is enabled

Type(s)

integer

_errors

An array of error messages or Exception objects.

inherited deprecated

Type(s)

array