TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Form\Domain\Model\Attribute\AttributesAttribute Class Reference
Inheritance diagram for TYPO3\CMS\Form\Domain\Model\Attribute\AttributesAttribute:
tx_form_Domain_Model_Attributes_Attributes

Public Member Functions

 __construct ($elementId)
 
 addAttribute ($class, $value)
 
 removeAttribute ($class)
 
 getAttributes ()
 
 getAttributeObjectByKey ($key)
 
 setAttribute ($key, $attributeObject)
 
 hasAttribute ($key)
 
 setValue ($key, $value)
 
 getValue ($key)
 

Protected Attributes

 $attributes = array()
 
 $elementId
 
 $localCobj
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! Attribute class for the form elements

Author
Patrick Broens patri.nosp@m.ck@p.nosp@m.atric.nosp@m.kbro.nosp@m.ens.n.nosp@m.l

Definition at line 22 of file AttributesAttribute.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Form\Domain\Model\Attribute\AttributesAttribute::__construct (   $elementId)

Constructor

Parameters
integer$elementIdThe ID of the element
Returns
void

Definition at line 51 of file AttributesAttribute.php.

References TYPO3\CMS\Form\Domain\Model\Attribute\AttributesAttribute\$elementId, and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Member Function Documentation

◆ addAttribute()

TYPO3\CMS\Form\Domain\Model\Attribute\AttributesAttribute::addAttribute (   $class,
  $value 
)

Add an attribute object to the attribute array

Parameters
string$className of the attribute
mixed$valueTyposcript configuration to construct value
Returns
tx_form_Domain_Model_Attributes

Definition at line 65 of file AttributesAttribute.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

◆ getAttributeObjectByKey()

TYPO3\CMS\Form\Domain\Model\Attribute\AttributesAttribute::getAttributeObjectByKey (   $key)

Get a specific attribute object by using the key

Parameters
string$keyKey of the attribute
Returns
The attribute object

Definition at line 99 of file AttributesAttribute.php.

Referenced by TYPO3\CMS\Form\Domain\Model\Attribute\AttributesAttribute\getValue(), and TYPO3\CMS\Form\Domain\Model\Attribute\AttributesAttribute\setValue().

◆ getAttributes()

TYPO3\CMS\Form\Domain\Model\Attribute\AttributesAttribute::getAttributes ( )

Get the attributes of the object

Returns
array Attributes objects

Definition at line 89 of file AttributesAttribute.php.

References TYPO3\CMS\Form\Domain\Model\Attribute\AttributesAttribute\$attributes.

◆ getValue()

TYPO3\CMS\Form\Domain\Model\Attribute\AttributesAttribute::getValue (   $key)

Get a specific attribute value by using the key

Parameters
string$keyKey of the attribute
Returns
string The content of the attribute

Definition at line 141 of file AttributesAttribute.php.

References TYPO3\CMS\Form\Domain\Model\Attribute\AttributesAttribute\getAttributeObjectByKey(), and TYPO3\CMS\Form\Domain\Model\Attribute\AttributesAttribute\hasAttribute().

◆ hasAttribute()

TYPO3\CMS\Form\Domain\Model\Attribute\AttributesAttribute::hasAttribute (   $key)

Returns TRUE if attribute is set

Parameters
string$keyThe name of the attribute
Returns
boolean

Definition at line 120 of file AttributesAttribute.php.

Referenced by TYPO3\CMS\Form\Domain\Model\Attribute\AttributesAttribute\getValue().

◆ removeAttribute()

TYPO3\CMS\Form\Domain\Model\Attribute\AttributesAttribute::removeAttribute (   $class)

Remove an attribute object from the attribute array

Parameters
string$className of the attribute
Returns
tx_form_Domain_Model_Attributes

Definition at line 79 of file AttributesAttribute.php.

◆ setAttribute()

TYPO3\CMS\Form\Domain\Model\Attribute\AttributesAttribute::setAttribute (   $key,
  $attributeObject 
)

Add an attribute object to the attribute array

Parameters
string$keyThe name of the attribute
object$attributeObjectThe attribute object
Returns
void

Definition at line 110 of file AttributesAttribute.php.

◆ setValue()

TYPO3\CMS\Form\Domain\Model\Attribute\AttributesAttribute::setValue (   $key,
  $value 
)

Set the value of a specific attribute object

Parameters
$keystring Name of the object
$valuestring The value
Returns
void

Definition at line 131 of file AttributesAttribute.php.

References TYPO3\CMS\Form\Domain\Model\Attribute\AttributesAttribute\getAttributeObjectByKey().

Member Data Documentation

◆ $attributes

TYPO3\CMS\Form\Domain\Model\Attribute\AttributesAttribute::$attributes = array()
protected

◆ $elementId

TYPO3\CMS\Form\Domain\Model\Attribute\AttributesAttribute::$elementId
protected

◆ $localCobj

TYPO3\CMS\Form\Domain\Model\Attribute\AttributesAttribute::$localCobj
protected

Definition at line 43 of file AttributesAttribute.php.