TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Form\Domain\Model\Element\AbstractElement Class Reference
Inheritance diagram for TYPO3\CMS\Form\Domain\Model\Element\AbstractElement:
tx_form_Domain_Model_Element_Abstract TYPO3\CMS\Form\Domain\Model\Element\AbstractPlainElement TYPO3\CMS\Form\Domain\Model\Element\ButtonElement TYPO3\CMS\Form\Domain\Model\Element\CheckboxElement TYPO3\CMS\Form\Domain\Model\Element\ContainerElement TYPO3\CMS\Form\Domain\Model\Element\ContentElement TYPO3\CMS\Form\Domain\Model\Element\FileuploadElement TYPO3\CMS\Form\Domain\Model\Element\HiddenElement TYPO3\CMS\Form\Domain\Model\Element\ImagebuttonElement TYPO3\CMS\Form\Domain\Model\Element\OptionElement TYPO3\CMS\Form\Domain\Model\Element\PasswordElement TYPO3\CMS\Form\Domain\Model\Element\RadioElement TYPO3\CMS\Form\Domain\Model\Element\ResetElement TYPO3\CMS\Form\Domain\Model\Element\SubmitElement TYPO3\CMS\Form\Domain\Model\Element\TextareaElement TYPO3\CMS\Form\Domain\Model\Element\TextlineElement

Public Member Functions

 __construct ()
 
 setElementId ()
 
 getElementId ()
 
 getElementType ()
 
 setName ($name='')
 
 getName ()
 
 acceptsParentName ()
 
 setAttribute ($attribute, $value)
 
 getAllowedAttributes ()
 
 getMandatoryAttributes ()
 
 hasAllowedAttributes ()
 
 hasAllowedAdditionals ()
 
 getAllowedAdditionals ()
 
 getAttributes ()
 
 hasAttribute ($key)
 
 getAttributeValue ($key)
 
 getAdditional ()
 
 getAdditionalObjectByKey ($key)
 
 getAdditionalValue ($key)
 
 setLayout ($layout='')
 
 getLayout ()
 
 setValue ($value='')
 
 getValue ()
 
 setData ($data='')
 
 setMessagesFromValidation ()
 
 setErrorsFromValidation ()
 
 setAdditional ($additional, $type, $value)
 
 additionalIsSet ($key)
 
 setAdditionalLayout ($key, $layout)
 
 makeFilter ($class, $arguments=array())
 
 addFilter ($filter)
 
 checkFilterAndSetIncomingDataFromRequest ()
 

Public Attributes

const ELEMENT_TYPE_FORM = 'FORM'
 
const ELEMENT_TYPE_PLAIN = 'PLAIN'
 
const ELEMENT_TYPE_CONTENT = 'CONTENT'
 

Protected Member Functions

 createAttributes ()
 
 createAdditional ()
 
 createFilter ()
 

Protected Attributes

 $elementId
 
 $elementType = self::ELEMENT_TYPE_FORM
 
 $name
 
 $acceptsParentName = FALSE
 
 $attributes
 
 $additional
 
 $layout
 
 $value
 
 $data
 
 $allowedAdditional
 
 $mandatoryAttributes = array()
 
 $allowedAttributes = array()
 
 $localCobj
 
 $requestHandler
 
 $elementCounter
 
 $validateClass
 
 $filter
 

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! Abstract 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 AbstractElement.php.

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ acceptsParentName()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::acceptsParentName ( )

Check to see if this element accepts the parent name instead of its own

Returns
boolean

Definition at line 227 of file AbstractElement.php.

References TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\$acceptsParentName.

◆ addFilter()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::addFilter (   $filter)

Add a filter to the filter list This is a shortcut to the function in _filter

Parameters
object$filterFilter object
Returns
void

Definition at line 502 of file AbstractElement.php.

References TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\$filter.

◆ additionalIsSet()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::additionalIsSet (   $key)

Check if additional exists

Parameters
string$keyName of the additional
Returns
boolean

Definition at line 448 of file AbstractElement.php.

◆ checkFilterAndSetIncomingDataFromRequest()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::checkFilterAndSetIncomingDataFromRequest ( )

Dummy function to check the request handler on input and set submitted data right for elements

Returns

Definition at line 512 of file AbstractElement.php.

◆ createAdditional()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::createAdditional ( )
protected

Load the additional object

Returns
void

Definition at line 457 of file AbstractElement.php.

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

Referenced by TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\__construct().

◆ createAttributes()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::createAttributes ( )
protected

Load the attributes object

Returns
void

Definition at line 353 of file AbstractElement.php.

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

Referenced by TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\__construct().

◆ createFilter()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::createFilter ( )
protected

Load the filter object

Returns
void

Definition at line 478 of file AbstractElement.php.

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

Referenced by TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\__construct().

◆ getAdditional()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::getAdditional ( )

Get the array with all additional objects for the element

Returns
array

Definition at line 324 of file AbstractElement.php.

◆ getAdditionalObjectByKey()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::getAdditionalObjectByKey (   $key)

Get a specific additional object by using the key

Parameters
string$keyKey of the additional
Returns
string The additional object

Definition at line 334 of file AbstractElement.php.

◆ getAdditionalValue()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::getAdditionalValue (   $key)

Get the value of a specific additional by key

Parameters
string$keyName of the additional
Returns
mixed

Definition at line 344 of file AbstractElement.php.

◆ getAllowedAdditionals()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::getAllowedAdditionals ( )

Get the allowed additionals for an element

Returns
array The allowed additionals

Definition at line 286 of file AbstractElement.php.

References TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\$allowedAdditional.

◆ getAllowedAttributes()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::getAllowedAttributes ( )

Get the allowed attributes for an element

Returns
array The allowed attributes

Definition at line 250 of file AbstractElement.php.

References TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\$allowedAttributes.

◆ getAttributes()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::getAttributes ( )

Get the array with all attribute objects for the element

Returns
array

Definition at line 295 of file AbstractElement.php.

◆ getAttributeValue()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::getAttributeValue (   $key)

Get the value of a specific attribute by key

Parameters
string$keyName of the attribute
Returns
mixed

Definition at line 315 of file AbstractElement.php.

Referenced by TYPO3\CMS\Form\Domain\Model\Element\ResetElement\setValue().

◆ getElementId()

◆ getElementType()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::getElementType ( )

Gets the element type.

Returns
string

Definition at line 192 of file AbstractElement.php.

References TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\$elementType.

◆ getLayout()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::getLayout ( )

Get the layout for an element

Returns
string XML for layout

Definition at line 373 of file AbstractElement.php.

References TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\$layout.

◆ getMandatoryAttributes()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::getMandatoryAttributes ( )

Get the mandatory attributes for an element

Returns
array The mandatory attributes

Definition at line 259 of file AbstractElement.php.

References TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\$mandatoryAttributes.

◆ getName()

◆ getValue()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::getValue ( )

Get the value for the element

Returns
mixed

Definition at line 392 of file AbstractElement.php.

References TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\$value.

◆ hasAllowedAdditionals()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::hasAllowedAdditionals ( )

Check if element has additionals which are allowed

Returns
boolean TRUE if there is a list of allowed additionals

Definition at line 277 of file AbstractElement.php.

◆ hasAllowedAttributes()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::hasAllowedAttributes ( )

Check if element has attributes which are allowed

Returns
boolean TRUE if there is a list of allowed attributes

Definition at line 268 of file AbstractElement.php.

◆ hasAttribute()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::hasAttribute (   $key)

Returns TRUE if attribute is set

Parameters
string$keyThe name of the attribute
Returns
boolean

Definition at line 305 of file AbstractElement.php.

◆ makeFilter()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::makeFilter (   $class,
  $arguments = array() 
)

Make a filter object for an element This is a shortcut to the function in _filter

Parameters
string$className of the filter
array$argumentsArguments for the filter
Returns
object Filter object

Definition at line 490 of file AbstractElement.php.

References TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\$filter.

◆ setAdditional()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::setAdditional (   $additional,
  $type,
  $value 
)

Set a specific additional by name and value

Parameters
string$additionalName of the additional
mixed$valueValue of the additional
Returns

Definition at line 437 of file AbstractElement.php.

References TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\$additional, and TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\$value.

Referenced by TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\setErrorsFromValidation(), and TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\setMessagesFromValidation().

◆ setAdditionalLayout()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::setAdditionalLayout (   $key,
  $layout 
)

Set the layout for an additional element

Parameters
string$keyName of the additional
string$layoutXML for layout
Returns
void

Definition at line 469 of file AbstractElement.php.

References TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\$layout.

◆ setAttribute()

◆ setData()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::setData (   $data = '')

Set the content for the element

Parameters
string$dataThe content
Returns
void

Definition at line 402 of file AbstractElement.php.

References TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\$data.

◆ setElementId()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::setElementId ( )

Set the internal ID of the element

Parameters
integer$elementIdInternal Id of the element
Returns
void

Definition at line 173 of file AbstractElement.php.

Referenced by TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\__construct().

◆ setErrorsFromValidation()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::setErrorsFromValidation ( )

Set the additional error from validation rules

Returns
void

Definition at line 423 of file AbstractElement.php.

References TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\getName(), and TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\setAdditional().

◆ setLayout()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::setLayout (   $layout = '')

Set the layout override for the element

Parameters
string$layoutThe layout
Returns
void

Definition at line 364 of file AbstractElement.php.

References TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\$layout.

◆ setMessagesFromValidation()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::setMessagesFromValidation ( )

Set the additionals from validation rules

Returns
void

Definition at line 411 of file AbstractElement.php.

References TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\getName(), and TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\setAdditional().

◆ setName()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::setName (   $name = '')

Set the name for the element

Parameters
string$nameThe name
Returns
void

Definition at line 202 of file AbstractElement.php.

References TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\$name, and TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\getElementId().

◆ setValue()

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::setValue (   $value = '')

Set the value for the element

Parameters
string$valueThe value
Returns
void

Definition at line 383 of file AbstractElement.php.

References TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\$value.

Member Data Documentation

◆ $acceptsParentName

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::$acceptsParentName = FALSE
protected

◆ $additional

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::$additional
protected

◆ $allowedAdditional

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::$allowedAdditional
protected
Initial value:
= array(
'label',
'legend'
)

Definition at line 106 of file AbstractElement.php.

Referenced by TYPO3\CMS\Form\Domain\Model\Element\AbstractElement\getAllowedAdditionals().

◆ $allowedAttributes

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::$allowedAttributes = array()
protected

◆ $attributes

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::$attributes
protected

Definition at line 70 of file AbstractElement.php.

◆ $data

◆ $elementCounter

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::$elementCounter
protected

Definition at line 138 of file AbstractElement.php.

◆ $elementId

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::$elementId
protected

◆ $elementType

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::$elementType = self::ELEMENT_TYPE_FORM
protected

◆ $filter

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::$filter
protected

◆ $layout

◆ $localCobj

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::$localCobj
protected

Definition at line 128 of file AbstractElement.php.

◆ $mandatoryAttributes

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::$mandatoryAttributes = array()
protected

◆ $name

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::$name
protected

◆ $requestHandler

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::$requestHandler
protected

Definition at line 133 of file AbstractElement.php.

◆ $validateClass

TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::$validateClass
protected

Definition at line 143 of file AbstractElement.php.

◆ $value

◆ ELEMENT_TYPE_CONTENT

const TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::ELEMENT_TYPE_CONTENT = 'CONTENT'

◆ ELEMENT_TYPE_FORM

const TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::ELEMENT_TYPE_FORM = 'FORM'

◆ ELEMENT_TYPE_PLAIN

const TYPO3\CMS\Form\Domain\Model\Element\AbstractElement::ELEMENT_TYPE_PLAIN = 'PLAIN'