‪TYPO3CMS  9.5
TYPO3\CMS\Extbase\Reflection\ReflectionService Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Reflection\ReflectionService:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

 __construct (CacheManager $cacheManager=null)
 
 __destruct ()
 
array getClassTagsValues ($className)
 
array getClassTagValues ($className, $tag)
 
array getClassPropertyNames ($className)
 
ClassSchema getClassSchema ($classNameOrObject)
 
bool hasMethod ($className, $methodName)
 
array getMethodTagsValues ($className, $methodName)
 
array getMethodParameters ($className, $methodName)
 
array getPropertyTagsValues ($className, $propertyName)
 
array getPropertyTagValues ($className, $propertyName, $tag)
 
bool isClassTaggedWith ($className, $tag)
 
bool isPropertyTaggedWith ($className, $propertyName, $tag)
 
 __sleep ()
 
 __wakeup ()
 

Public Attributes

const CACHE_IDENTIFIER = 'extbase_reflection'
 
const CACHE_ENTRY_IDENTIFIER = 'ClassSchematas'
 

Protected Member Functions

ClassSchema buildClassSchema ($className)
 

Protected Attributes

FrontendInterface $dataCache
 
bool $dataCacheNeedsUpdate = false
 
array $classSchemata = array( )
 

Private Attributes

bool $cachingEnabled = false
 

Detailed Description

Reflection service for acquiring reflection based information. Originally based on the TYPO3.Flow reflection service.

Definition at line 26 of file ReflectionService.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Extbase\Reflection\ReflectionService::__construct ( CacheManager  $cacheManager = null)

If not $cacheManager is injected, the reflection service does not cache any data, useful for testing this service in unit tests.

Parameters
CacheManager$cacheManager

Definition at line 60 of file ReflectionService.php.

References TYPO3\CMS\Extbase\Reflection\ReflectionService\$classSchemata.

◆ __destruct()

TYPO3\CMS\Extbase\Reflection\ReflectionService::__destruct ( )

Definition at line 78 of file ReflectionService.php.

Member Function Documentation

◆ __sleep()

TYPO3\CMS\Extbase\Reflection\ReflectionService::__sleep ( )

Definition at line 377 of file ReflectionService.php.

◆ __wakeup()

TYPO3\CMS\Extbase\Reflection\ReflectionService::__wakeup ( )

Definition at line 385 of file ReflectionService.php.

◆ buildClassSchema()

ClassSchema TYPO3\CMS\Extbase\Reflection\ReflectionService::buildClassSchema (   $className)
protected

Builds class schemata from classes annotated as entities or value objects

Parameters
string$className
Exceptions
Exception

Definition at line 362 of file ReflectionService.php.

Referenced by TYPO3\CMS\Extbase\Reflection\ReflectionService\getClassSchema().

◆ getClassPropertyNames()

array TYPO3\CMS\Extbase\Reflection\ReflectionService::getClassPropertyNames (   $className)

Returns the names of all properties of the specified class

Parameters
string$className‪Name of the class to return the property names of
Returns
‪array An array of property names or an empty array if none exist
Deprecated:
‪since TYPO3 v9, will be removed in TYPO3 v10.0.

Definition at line 139 of file ReflectionService.php.

References TYPO3\CMS\Extbase\Reflection\ReflectionService\getClassSchema().

◆ getClassSchema()

◆ getClassTagsValues()

array TYPO3\CMS\Extbase\Reflection\ReflectionService::getClassTagsValues (   $className)

Returns all tags and their values the specified class is tagged with

Parameters
string$className‪Name of the class
Returns
‪array An array of tags and their values or an empty array if no tags were found
Deprecated:
‪since TYPO3 v9, will be removed in TYPO3 v10.0.

Definition at line 92 of file ReflectionService.php.

References TYPO3\CMS\Extbase\Reflection\ReflectionService\getClassSchema().

◆ getClassTagValues()

array TYPO3\CMS\Extbase\Reflection\ReflectionService::getClassTagValues (   $className,
  $tag 
)

Returns the values of the specified class tag

Parameters
string$className‪Name of the class containing the property
string$tag‪Tag to return the values of
Returns
‪array An array of values or an empty array if the tag was not found
Deprecated:
‪since TYPO3 v9, will be removed in TYPO3 v10.0.

Definition at line 116 of file ReflectionService.php.

References TYPO3\CMS\Extbase\Reflection\ReflectionService\getClassSchema().

◆ getMethodParameters()

array TYPO3\CMS\Extbase\Reflection\ReflectionService::getMethodParameters (   $className,
  $methodName 
)

Returns an array of parameters of the given method. Each entry contains additional information about the parameter position, type hint etc.

Parameters
string$className‪Name of the class containing the method
string$methodName‪Name of the method to return parameter information of
Returns
‪array An array of parameter names and additional information or an empty array of no parameters were found
Deprecated:
‪since TYPO3 v9, will be removed in TYPO3 v10.0.

Definition at line 229 of file ReflectionService.php.

References TYPO3\CMS\Extbase\Reflection\ReflectionService\getClassSchema().

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\ActionController\getActionMethodParameters().

◆ getMethodTagsValues()

array TYPO3\CMS\Extbase\Reflection\ReflectionService::getMethodTagsValues (   $className,
  $methodName 
)

Returns all tags and their values the specified method is tagged with

Parameters
string$className‪Name of the class containing the method
string$methodName‪Name of the method to return the tags and values of
Returns
‪array An array of tags and their values or an empty array of no tags were found
Deprecated:
‪since TYPO3 v9, will be removed in TYPO3 v10.0.

Definition at line 204 of file ReflectionService.php.

References TYPO3\CMS\Extbase\Reflection\ReflectionService\getClassSchema().

◆ getPropertyTagsValues()

array TYPO3\CMS\Extbase\Reflection\ReflectionService::getPropertyTagsValues (   $className,
  $propertyName 
)

Returns all tags and their values the specified class property is tagged with

Parameters
string$className‪Name of the class containing the property
string$propertyName‪Name of the property to return the tags and values of
Returns
‪array An array of tags and their values or an empty array of no tags were found
Deprecated:
‪since TYPO3 v9, will be removed in TYPO3 v10.0.

Definition at line 253 of file ReflectionService.php.

References TYPO3\CMS\Extbase\Reflection\ReflectionService\getClassSchema().

◆ getPropertyTagValues()

array TYPO3\CMS\Extbase\Reflection\ReflectionService::getPropertyTagValues (   $className,
  $propertyName,
  $tag 
)

Returns the values of the specified class property tag

Parameters
string$className‪Name of the class containing the property
string$propertyName‪Name of the tagged property
string$tag‪Tag to return the values of
Returns
‪array An array of values or an empty array if the tag was not found
Deprecated:
‪since TYPO3 v9, will be removed in TYPO3 v10.0.

Definition at line 278 of file ReflectionService.php.

References TYPO3\CMS\Extbase\Reflection\ReflectionService\getClassSchema().

◆ hasMethod()

bool TYPO3\CMS\Extbase\Reflection\ReflectionService::hasMethod (   $className,
  $methodName 
)

Wrapper for method_exists() which tells if the given method exists.

Parameters
string$className‪Name of the class containing the method
string$methodName‪Name of the method
Returns
‪bool
Deprecated:
‪since TYPO3 v9, will be removed in TYPO3 v10.0.

Definition at line 180 of file ReflectionService.php.

References TYPO3\CMS\Extbase\Reflection\ReflectionService\getClassSchema().

◆ isClassTaggedWith()

bool TYPO3\CMS\Extbase\Reflection\ReflectionService::isClassTaggedWith (   $className,
  $tag 
)

Tells if the specified class is tagged with the given tag

Parameters
string$className‪Name of the class
string$tag‪Tag to check for
Returns
‪bool TRUE if the class is tagged with $tag, otherwise FALSE
Deprecated:
‪since TYPO3 v9, will be removed in TYPO3 v10.0.

Definition at line 302 of file ReflectionService.php.

References TYPO3\CMS\Extbase\Reflection\ReflectionService\getClassSchema().

◆ isPropertyTaggedWith()

bool TYPO3\CMS\Extbase\Reflection\ReflectionService::isPropertyTaggedWith (   $className,
  $propertyName,
  $tag 
)

Tells if the specified class property is tagged with the given tag

Parameters
string$className‪Name of the class
string$propertyName‪Name of the property
string$tag‪Tag to check for
Returns
‪bool TRUE if the class property is tagged with $tag, otherwise FALSE
Deprecated:
‪since TYPO3 v9, will be removed in TYPO3 v10.0.

Definition at line 333 of file ReflectionService.php.

References TYPO3\CMS\Extbase\Reflection\ReflectionService\getClassSchema().

Member Data Documentation

◆ $cachingEnabled

bool TYPO3\CMS\Extbase\Reflection\ReflectionService::$cachingEnabled = false
private

Definition at line 52 of file ReflectionService.php.

◆ $classSchemata

array TYPO3\CMS\Extbase\Reflection\ReflectionService::$classSchemata = array( )
protected

Local cache for Class schemata

Definition at line 48 of file ReflectionService.php.

Referenced by TYPO3\CMS\Extbase\Reflection\ReflectionService\__construct().

◆ $dataCache

FrontendInterface TYPO3\CMS\Extbase\Reflection\ReflectionService::$dataCache
protected

Definition at line 33 of file ReflectionService.php.

◆ $dataCacheNeedsUpdate

bool TYPO3\CMS\Extbase\Reflection\ReflectionService::$dataCacheNeedsUpdate = false
protected

Indicates whether the Reflection cache needs to be updated.

This flag needs to be set as soon as new Reflection information was created.

Definition at line 42 of file ReflectionService.php.

◆ CACHE_ENTRY_IDENTIFIER

const TYPO3\CMS\Extbase\Reflection\ReflectionService::CACHE_ENTRY_IDENTIFIER = 'ClassSchematas'

Definition at line 29 of file ReflectionService.php.

◆ CACHE_IDENTIFIER

const TYPO3\CMS\Extbase\Reflection\ReflectionService::CACHE_IDENTIFIER = 'extbase_reflection'

Definition at line 28 of file ReflectionService.php.