TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Core\Type\Enumeration Class Reference
Inheritance diagram for TYPO3\CMS\Core\Type\Enumeration:
TYPO3\CMS\Core\Type\TypeInterface TYPO3\CMS\Core\DataHandling\TableColumnSubType TYPO3\CMS\Core\DataHandling\TableColumnType TYPO3\CMS\Core\Tests\Unit\Type\Fixture\Enumeration\CompleteEnumeration TYPO3\CMS\Core\Tests\Unit\Type\Fixture\Enumeration\DuplicateConstantValueEnumeration TYPO3\CMS\Core\Tests\Unit\Type\Fixture\Enumeration\InvalidConstantEnumeration TYPO3\CMS\Core\Tests\Unit\Type\Fixture\Enumeration\MissingConstantsEnumeration TYPO3\CMS\Core\Tests\Unit\Type\Fixture\Enumeration\MissingDefaultEnumeration TYPO3\CMS\Core\Versioning\VersionState

Public Member Functions

 __construct ($value=NULL)
 
 equals ($value)
 
 __toString ()
 

Static Public Member Functions

static getConstants ($include_default=FALSE)
 
static cast ($value)
 

Protected Member Functions

 setValue ($value)
 
 isValid ($value)
 

Static Protected Member Functions

static loadValues ()
 

Protected Attributes

 $value
 

Static Protected Attributes

static $enumConstants
 

Detailed Description

Abstract class for Enumeration. Inspired by SplEnum.

The prefix "Abstract" has been left out by intention because a "type" is abstract by definition.

Definition at line 26 of file Enumeration.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Type\Enumeration::__construct (   $value = NULL)

Member Function Documentation

◆ __toString()

TYPO3\CMS\Core\Type\Enumeration::__toString ( )

◆ cast()

static TYPO3\CMS\Core\Type\Enumeration::cast (   $value)
static

Cast value to enumeration type

Parameters
mixed$valueValue that has to be casted
Returns
Enumeration

Definition at line 177 of file Enumeration.php.

References TYPO3\CMS\Core\Type\Enumeration\$value.

Referenced by TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode\canBeCopied(), TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode\canBeCut(), TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode\canBePastedAfter(), TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode\canBePastedInto(), TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode\canBeRemoved(), TYPO3\CMS\Workspaces\Service\WorkspaceService\canCreatePreviewLink(), TYPO3\CMS\Workspaces\Service\IntegrityService\checkLocalization(), TYPO3\CMS\Version\Dependency\ElementEntityProcessor\createClearDependentElementChildReferenceCallback(), TYPO3\CMS\Version\Dependency\ElementEntityProcessor\createClearDependentElementParentReferenceCallback(), TYPO3\CMS\Core\DataHandling\DataHandler\deleteL10nOverlayRecords(), TYPO3\CMS\Core\DataHandling\DataHandler\deleteVersionsForRecord(), TYPO3\CMS\Backend\Utility\BackendUtility\fixVersioningPid(), TYPO3\CMS\Backend\Controller\PageLayoutController\getButtons(), TYPO3\CMS\Backend\Utility\IconUtility\getIcon(), TYPO3\CMS\Backend\Form\Element\InlineElement\getNewRecordPid(), TYPO3\CMS\Backend\View\PageLayoutView\getSelectedBackendLayoutUid(), TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode\isDeleted(), TYPO3\CMS\Workspaces\Service\WorkspaceService\isNewPage(), TYPO3\CMS\Lowlevel\VersionsCommand\main(), TYPO3\CMS\Frontend\Page\PageRepository\movePlhOL(), TYPO3\CMS\Backend\Utility\BackendUtility\movePlhOL(), TYPO3\CMS\Version\Hook\DataHandlerHook\moveRecord(), TYPO3\CMS\Version\Hook\DataHandlerHook\moveRecord_processFieldValue(), TYPO3\CMS\Version\Hook\IconUtilityHook\overrideIconOverlay(), TYPO3\CMS\Core\DataHandling\DataHandler\placeholderShadowing(), TYPO3\CMS\Version\Hook\DataHandlerHook\processCmdmap_deleteAction(), TYPO3\CMS\Core\DataHandling\PlainDataResolver\processVersionOverlays(), TYPO3\CMS\Core\Database\RelationHandler\purgeDeletePlaceholder(), TYPO3\CMS\Version\Hook\DataHandlerHook\version_clearWSID(), TYPO3\CMS\Core\DataHandling\DataHandler\versionizeRecord(), TYPO3\CMS\Frontend\Page\PageRepository\versionOL(), TYPO3\CMS\Workspaces\Service\WorkspaceService\viewSingleRecord(), TYPO3\CMS\Backend\Utility\BackendUtility\workspaceOL(), and TYPO3\CMS\Core\Database\RelationHandler\writeForeignField().

◆ equals()

TYPO3\CMS\Core\Type\Enumeration::equals (   $value)

Compare if the value of the current object value equals the given value

Parameters
mixed$valuedefault
Returns
boolean

Definition at line 191 of file Enumeration.php.

References TYPO3\CMS\Core\Type\Enumeration\$value.

◆ getConstants()

static TYPO3\CMS\Core\Type\Enumeration::getConstants (   $include_default = FALSE)
static

Get the valid values for this enum Defaults to constants you define in your subclass override to provide custom functionality

Parameters
boolean$include_default
Returns
array

Definition at line 162 of file Enumeration.php.

References TYPO3\CMS\Core\Type\Enumeration\$enumConstants.

Referenced by TYPO3\CMS\Core\Tests\Unit\Type\EnumerationTest\getConstantsReturnsArrayOfPossibleValuesWithDefaultIfRequested(), and TYPO3\CMS\Core\Tests\Unit\Type\EnumerationTest\getConstantsReturnsArrayOfPossibleValuesWithoutDefault().

◆ isValid()

TYPO3\CMS\Core\Type\Enumeration::isValid (   $value)
protected

Check if the value on this enum is a valid value for the enum

Parameters
mixed$value
Returns
boolean

Definition at line 144 of file Enumeration.php.

References TYPO3\CMS\Core\Type\Enumeration\$value.

Referenced by TYPO3\CMS\Core\Type\Enumeration\__construct().

◆ loadValues()

static TYPO3\CMS\Core\Type\Enumeration::loadValues ( )
staticprotected
Exceptions
Exception

Definition at line 67 of file Enumeration.php.

References TYPO3\CMS\Core\Type\Enumeration\$value.

◆ setValue()

TYPO3\CMS\Core\Type\Enumeration::setValue (   $value)
protected

Set the Enumeration value to the associated enumeration value by a loose comparison. The value, that is used as the enumeration value, will be of the same type like defined in the enumeration

Parameters
mixed$value
Exceptions
Exception

Definition at line 127 of file Enumeration.php.

References TYPO3\CMS\Core\Type\Enumeration\$value.

Referenced by TYPO3\CMS\Core\Type\Enumeration\__construct().

Member Data Documentation

◆ $enumConstants

TYPO3\CMS\Core\Type\Enumeration::$enumConstants
staticprotected

Definition at line 36 of file Enumeration.php.

Referenced by TYPO3\CMS\Core\Type\Enumeration\getConstants().

◆ $value