TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
Enumeration Class Reference
Inheritance diagram for Enumeration:
TypeInterface InformationStatus TableColumnSubType TableColumnType DuplicationBehavior CompleteEnumeration DuplicateConstantValueEnumeration InvalidConstantEnumeration MissingConstantsEnumeration MissingDefaultEnumeration JsConfirmation Permission IconState VersionState LikeWildcard

Public Member Functions

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

Static Public Member Functions

static getConstants ($include_default=false)
 
static cast ($value)
 
static getName ($value)
 
static getHumanReadableName ($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 24 of file Enumeration.php.

Constructor & Destructor Documentation

__construct (   $value = null)
Parameters
mixed$value
Exceptions
ExceptionInvalidEnumerationValueException

Definition at line 40 of file Enumeration.php.

References Enumeration\$value, Enumeration\isValid(), and Enumeration\setValue().

Member Function Documentation

__toString ( )
Returns
string

Implements TypeInterface.

Definition at line 207 of file Enumeration.php.

References Enumeration\$value.

Referenced by VersionState\indicatesPlaceholder().

static cast (   $value)
static

Cast value to enumeration type

Parameters
mixed$valueValue that has to be casted
Returns
self

Definition at line 183 of file Enumeration.php.

References Enumeration\$value.

Referenced by SystemInformationToolbarItem\__construct(), ResourceStorage\addFile(), ResourceStorage\addUploadedFile(), PagetreeNode\canBeCopied(), PagetreeNode\canBeCut(), PagetreeNode\canBePastedAfter(), PagetreeNode\canBePastedInto(), PagetreeNode\canBeRemoved(), WorkspaceService\canCreatePreviewLink(), IntegrityService\checkLocalization(), ImportExportController\checkUpload(), ElementEntityProcessor\createClearDependentElementChildReferenceCallback(), ElementEntityProcessor\createClearDependentElementParentReferenceCallback(), DataHandler\deleteL10nOverlayRecords(), DataHandler\deleteVersionsForRecord(), BackendUtility\fixVersioningPid(), LikeWildcardTest\getLikeQueryPart(), BackendUtility\getRecordIconAltText(), TcaInline\getWorkspacedUids(), FileController\init(), PagetreeNode\isDeleted(), WorkspaceService\isNewPage(), BackendUserAuthentication\jsConfirmation(), VersionsCommand\main(), PageLayoutController\makeButtons(), IconFactory\mapRecordTypeToOverlayIdentifier(), ResourceStorage\moveFile(), PageRepository\movePlhOL(), BackendUtility\movePlhOL(), DataHandlerHook\moveRecord(), DataHandlerHook\moveRecord_processFieldValue(), DataHandler\placeholderShadowing(), IconFactory\processAjaxRequest(), DataHandlerHook\processCmdmap_deleteAction(), PlainDataResolver\processVersionOverlays(), RelationHandler\purgeDeletePlaceholder(), IconViewHelperTest\renderCallsIconFactoryWithDefaultSizeAndDefaultStateAndReturnsResult(), IconViewHelperTest\renderCallsIconFactoryWithGivenOverlayAndReturnsResult(), IconViewHelperTest\renderCallsIconFactoryWithGivenSizeAndReturnsResult(), IconViewHelperTest\renderCallsIconFactoryWithGivenStateAndReturnsResult(), IndexSearchRepository\searchSentence(), IndexSearchRepository\searchWord(), ExtendedFileUtility\setExistingFilesConflictMode(), IconTest\setUp(), BackendUtility\titleAttribForPages(), DataHandlerHook\version_clearWSID(), DataHandler\versionizeRecord(), WorkspaceService\viewSingleRecord(), BackendUtility\workspaceOL(), and RelationHandler\writeForeignField().

equals (   $value)

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

Parameters
mixed$valuedefault
Returns
bool

Definition at line 198 of file Enumeration.php.

References Enumeration\$value.

static 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
bool$include_default
Returns
array

Definition at line 167 of file Enumeration.php.

References Enumeration\$enumConstants.

Referenced by EnumerationTest\getConstantsReturnsArrayOfPossibleValuesWithDefaultIfRequested(), EnumerationTest\getConstantsReturnsArrayOfPossibleValuesWithoutDefault(), and ExtendedFileUtility\setExistingFilesConflictMode().

static getHumanReadableName (   $value)
static

Returns the name of the constant, first char upper, underscores as spaces

Parameters
string | int$value
Returns
string

Definition at line 234 of file Enumeration.php.

References Enumeration\$value.

static getName (   $value)
static

Returns the constants name as is, without manipulation (usually all upper case)

Parameters
string | int$value
Returns
string

Definition at line 218 of file Enumeration.php.

References Enumeration\$value.

isValid (   $value)
protected

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

Parameters
mixed$value
Returns
bool

Definition at line 148 of file Enumeration.php.

References Enumeration\$value.

Referenced by Enumeration\__construct().

static loadValues ( )
staticprotected
Exceptions
ExceptionInvalidEnumerationValueException
ExceptionInvalidEnumerationDefinitionException

Definition at line 66 of file Enumeration.php.

References Enumeration\$value.

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
ExceptionInvalidEnumerationValueException

Definition at line 130 of file Enumeration.php.

References Enumeration\$value.

Referenced by Enumeration\__construct().

Member Data Documentation

$enumConstants
staticprotected

Definition at line 34 of file Enumeration.php.

Referenced by Enumeration\getConstants().