‪TYPO3CMS  10.4
TYPO3\CMS\Core\Type\Enumeration Class Reference
Inheritance diagram for TYPO3\CMS\Core\Type\Enumeration:
TYPO3\CMS\Core\Type\TypeInterface TYPO3\CMS\Backend\Toolbar\Enumeration\InformationStatus TYPO3\CMS\Core\Authentication\LoginType TYPO3\CMS\Core\DataHandling\TableColumnSubType TYPO3\CMS\Core\DataHandling\TableColumnType TYPO3\CMS\Core\Resource\DuplicationBehavior 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\Type\Bitmask\JsConfirmation TYPO3\CMS\Core\Type\Bitmask\Permission TYPO3\CMS\Core\Type\Icon\IconState TYPO3\CMS\Core\Versioning\VersionState TYPO3\CMS\IndexedSearch\Utility\LikeWildcard TYPO3\CMS\Scheduler\Task\Enumeration\Action

Public Member Functions

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

Static Public Member Functions

static array getConstants ($include_default=false)
 
static static cast ($value)
 
static string getName ($value)
 
static string getHumanReadableName ($value)
 

Protected Member Functions

 setValue ($value)
 
bool isValid ($value)
 

Static Protected Member Functions

static loadValues ()
 

Protected Attributes

mixed $value
 

Static Protected Attributes

static array $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 28 of file Enumeration.php.

Constructor & Destructor Documentation

◆ __construct()

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

Member Function Documentation

◆ __toString()

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

◆ cast()

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

Cast value to enumeration type

Parameters
mixed$value‪Value that has to be casted
Returns
‪static

Definition at line 186 of file Enumeration.php.

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

Referenced by TYPO3\CMS\Backend\Backend\ToolbarItems\SystemInformationToolbarItem\__construct(), TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseEditRow\addData(), TYPO3\CMS\Core\Resource\ResourceStorage\addFile(), TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\addItemsFromForeignTable(), TYPO3\CMS\Backend\Backend\ToolbarItems\SystemInformationToolbarItem\addSystemMessage(), TYPO3\CMS\Core\Resource\ResourceStorage\addUploadedFile(), TYPO3\CMS\Workspaces\Preview\PreviewUriBuilder\buildUriForElement(), TYPO3\CMS\Workspaces\Controller\ReviewController\canCreatePreviewLink(), TYPO3\CMS\Core\Tests\Unit\Type\EnumerationTest\castReturnsGivenObjectIfCalledWithValueOfSameType(), TYPO3\CMS\Core\Tests\Unit\Type\EnumerationTest\castReturnsObjectOfCalledEnumerationTypeIfCalledWithValueOfDifferentType(), TYPO3\CMS\Core\Tests\Unit\Type\EnumerationTest\castReturnsObjectOfEnumerationTypeIfSimpleValueIsGiven(), TYPO3\CMS\Workspaces\Service\IntegrityService\checkLocalization(), TYPO3\CMS\Impexp\Controller\ImportController\checkUpload(), TYPO3\CMS\Core\Tests\Functional\Resource\ResourceStorageTest\copyFileGeneratesNewFileNameWhenFileAlreadyExistsInTargetFolderAndConflictModeIsRename(), TYPO3\CMS\Core\Tests\Functional\Resource\ResourceStorageTest\copyFileThrowsErrorWhenFileWithSameNameAlreadyExistsInTargetFolderAndConflictModeIsCancel(), TYPO3\CMS\Core\Resource\ResourceStorage\copyFolder(), TYPO3\CMS\Core\Tests\Functional\Resource\ResourceStorageTest\copyFolderGeneratesNewFolderNameWhenFolderAlreadyExistsInTargetFolderAndConflictModeIsRename(), TYPO3\CMS\Core\Tests\Functional\Resource\ResourceStorageTest\copyFolderThrowsErrorWhenFolderAlreadyExistsInTargetFolderAndConflictModeIsCancel(), TYPO3\CMS\Workspaces\Dependency\ElementEntityProcessor\createClearDependentElementChildReferenceCallback(), TYPO3\CMS\Workspaces\Dependency\ElementEntityProcessor\createClearDependentElementParentReferenceCallback(), TYPO3\CMS\Core\DataHandling\DataHandler\deleteL10nOverlayRecords(), TYPO3\CMS\Core\DataHandling\DataHandler\deleteVersionsForRecord(), TYPO3\CMS\Core\DataHandling\DataHandler\discard(), TYPO3\CMS\Core\DataHandling\DataHandler\discardLocalizationOverlayRecords(), TYPO3\CMS\Scheduler\Controller\SchedulerModuleController\executeTasks(), TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand\findInvalidMoveIdRecords(), TYPO3\CMS\Workspaces\Command\WorkspaceVersionRecordsCommand\findInvalidMovePlaceholderRecords(), TYPO3\CMS\Backend\View\PageLayoutView\generateLanguageView(), TYPO3\CMS\Backend\View\BackendLayout\Grid\LanguageColumn\getAllowViewPage(), TYPO3\CMS\Core\Controller\IconController\getIcon(), TYPO3\CMS\Install\Controller\IconController\getIconAction(), TYPO3\CMS\IndexedSearch\Tests\Functional\Utility\LikeWildcardTest\getLikeQueryPart(), TYPO3\CMS\Scheduler\Controller\SchedulerModuleController\getModuleContent(), TYPO3\CMS\Core\Domain\Repository\PageRepository\getMovedPidOfVersionedRecord(), TYPO3\CMS\Backend\Utility\BackendUtility\getRecordIconAltText(), TYPO3\CMS\Backend\Controller\Page\LocalizationController\getRecordLocalizeSummary(), TYPO3\CMS\Backend\View\BackendLayout\ContentFetcher\getResult(), TYPO3\CMS\Workspaces\Controller\Remote\RemoteServer\getRowDetails(), TYPO3\CMS\Backend\View\PageLayoutView\getTable_tt_content(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline\getWorkspacedUids(), TYPO3\CMS\Backend\Controller\File\FileController\init(), TYPO3\CMS\Filelist\Controller\FileListController\initializeObject(), TYPO3\CMS\Backend\ContextMenu\ItemProviders\RecordProvider\isDeletePlaceholder(), TYPO3\CMS\Workspaces\Service\WorkspaceService\isNewPage(), TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList\isRecordDeletePlaceholder(), TYPO3\CMS\Core\Authentication\BackendUserAuthentication\jsConfirmation(), TYPO3\CMS\Backend\Controller\EditDocumentController\languageSwitch(), TYPO3\CMS\Scheduler\Controller\SchedulerModuleController\mainAction(), TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\mainAction(), TYPO3\CMS\Backend\Controller\PageLayoutController\makeButtons(), TYPO3\CMS\Core\Imaging\IconFactory\mapRecordTypeToOverlayIdentifier(), TYPO3\CMS\Core\Resource\ResourceStorage\moveFile(), TYPO3\CMS\Core\Domain\Repository\PageRepository\movePlhOL(), TYPO3\CMS\Backend\Utility\BackendUtility\movePlhOL(), TYPO3\CMS\Workspaces\Hook\DataHandlerHook\moveRecord(), TYPO3\CMS\Workspaces\Hook\DataHandlerHook\moveRecord_processFieldValue(), TYPO3\CMS\Core\DataHandling\DataHandler\placeholderShadowing(), TYPO3\CMS\Workspaces\Hook\DataHandlerHook\processCmdmap_deleteAction(), TYPO3\CMS\Core\DataHandling\PlainDataResolver\processVersionOverlays(), TYPO3\CMS\Core\Database\RelationHandler\purgeDeletePlaceholder(), TYPO3\CMS\Core\Resource\ResourceStorage\renameFile(), TYPO3\CMS\Core\Tests\Unit\ViewHelpers\IconViewHelperTest\renderCallsIconFactoryWithDefaultSizeAndDefaultStateAndReturnsResult(), TYPO3\CMS\Core\Tests\Unit\ViewHelpers\IconViewHelperTest\renderCallsIconFactoryWithGivenOverlayAndReturnsResult(), TYPO3\CMS\Core\Tests\Unit\ViewHelpers\IconViewHelperTest\renderCallsIconFactoryWithGivenSizeAndReturnsResult(), TYPO3\CMS\Core\Tests\Unit\ViewHelpers\IconViewHelperTest\renderCallsIconFactoryWithGivenStateAndReturnsResult(), TYPO3\CMS\Filelist\Controller\File\RenameFileController\renderContent(), TYPO3\CMS\Core\ViewHelpers\IconViewHelper\renderStatic(), TYPO3\CMS\Core\Utility\RootlineUtility\resolvePageId(), TYPO3\CMS\Core\DataHandling\SlugHelper\resolveVersionOverlays(), TYPO3\CMS\IndexedSearch\Domain\Repository\IndexSearchRepository\searchSentence(), TYPO3\CMS\IndexedSearch\Domain\Repository\IndexSearchRepository\searchWord(), TYPO3\CMS\Core\Utility\File\ExtendedFileUtility\setExistingFilesConflictMode(), TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory\setType(), TYPO3\CMS\Core\Tests\Unit\Imaging\IconTest\setUp(), TYPO3\CMS\Backend\Utility\BackendUtility\titleAttribForPages(), TYPO3\CMS\Core\DataHandling\DataHandler\versionizeRecord(), TYPO3\CMS\Core\Domain\Repository\PageRepository\versionOL(), TYPO3\CMS\Backend\Utility\BackendUtility\workspaceOL(), and TYPO3\CMS\Core\Database\RelationHandler\writeForeignField().

◆ equals()

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

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

Parameters
mixed$value‪default
Returns
‪bool

Definition at line 200 of file Enumeration.php.

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

◆ getConstants()

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

Definition at line 170 of file Enumeration.php.

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

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

◆ getHumanReadableName()

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

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

Parameters
string | int$value
Returns
‪string

Definition at line 236 of file Enumeration.php.

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

Referenced by TYPO3\CMS\Core\Tests\Unit\Type\EnumerationTest\getHumanReadableNameProvidesNameForAvailableConstant().

◆ getName()

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

◆ isValid()

bool 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
‪bool

Reimplemented in TYPO3\CMS\Core\Type\Bitmask\JsConfirmation.

Definition at line 151 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 68 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

Reimplemented in TYPO3\CMS\Core\Type\Bitmask\JsConfirmation.

Definition at line 133 of file Enumeration.php.

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

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

Member Data Documentation

◆ $enumConstants

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

Definition at line 36 of file Enumeration.php.

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

◆ $value