ClassNamingUtility

Several functions related to naming and conversions of names such as translation between Repository and Model names or exploding an objectControllerName into pieces

Table of Contents

Methods

explodeObjectControllerName()  : array<string|int, mixed>
Explodes a controllerObjectName like \Vendor\Ext\Controller\FooController into several pieces like vendorName, extensionName, subpackageKey and controllerName
translateModelNameToRepositoryName()  : string
Translates a model name to an appropriate repository name e.g. Tx_Extbase_Domain_Model_Foo to Tx_Extbase_Domain_Repository_FooRepository or \TYPO3\CMS\Extbase\Domain\Model\Foo to \TYPO3\CMS\Extbase\Domain\Repository\FooRepository
translateRepositoryNameToModelName()  : class-string
Translates a repository name to an appropriate model name e.g. Tx_Extbase_Domain_Repository_FooRepository to Tx_Extbase_Domain_Model_Foo or \TYPO3\CMS\Extbase\Domain\Repository\FooRepository to \TYPO3\CMS\Extbase\Domain\Model\Foo

Methods

explodeObjectControllerName()

Explodes a controllerObjectName like \Vendor\Ext\Controller\FooController into several pieces like vendorName, extensionName, subpackageKey and controllerName

public static explodeObjectControllerName(string $controllerObjectName) : array<string|int, mixed>
Parameters
$controllerObjectName : string

The controller name to be exploded

Return values
array<string|int, mixed>

An array of controllerObjectName pieces

translateModelNameToRepositoryName()

Translates a model name to an appropriate repository name e.g. Tx_Extbase_Domain_Model_Foo to Tx_Extbase_Domain_Repository_FooRepository or \TYPO3\CMS\Extbase\Domain\Model\Foo to \TYPO3\CMS\Extbase\Domain\Repository\FooRepository

public static translateModelNameToRepositoryName(string $modelName) : string
Parameters
$modelName : string

Name of the model to translate

Return values
string

Name of the repository

translateRepositoryNameToModelName()

Translates a repository name to an appropriate model name e.g. Tx_Extbase_Domain_Repository_FooRepository to Tx_Extbase_Domain_Model_Foo or \TYPO3\CMS\Extbase\Domain\Repository\FooRepository to \TYPO3\CMS\Extbase\Domain\Model\Foo

public static translateRepositoryNameToModelName(RepositoryInterface> $repositoryName) : class-string
Parameters
$repositoryName : RepositoryInterface>

Name of the repository to translate

Return values
class-string

Name of the model


        
On this page

Search results