TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Extbase\Reflection\ReflectionService Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Reflection\ReflectionService:
TYPO3\CMS\Core\SingletonInterface Tx_Extbase_Reflection_Service

Public Member Functions

 setDataCache (\TYPO3\CMS\Core\Cache\Frontend\VariableFrontend $dataCache)
 
 initialize ()
 
 isInitialized ()
 
 shutdown ()
 
 getClassPropertyNames ($className)
 
 getClassSchema ($classNameOrObject)
 
 hasMethod ($className, $methodName)
 
 getMethodTagsValues ($className, $methodName)
 
 getMethodParameters ($className, $methodName)
 
 getPropertyTagsValues ($className, $propertyName)
 
 getPropertyTagValues ($className, $propertyName, $tag)
 
 isClassReflected ($className)
 
 isClassTaggedWith ($className, $tag)
 
 isPropertyTaggedWith ($className, $propertyName, $tag)
 

Protected Member Functions

 reflectClass ($className)
 
 buildClassSchema ($className)
 
 convertParameterReflectionToArray (\ReflectionParameter $parameter, $parameterPosition, \ReflectionMethod $method=NULL)
 
 getMethodReflection ($className, $methodName)
 
 loadFromCache ()
 
 saveToCache ()
 

Protected Attributes

 $objectManager
 
 $initialized = FALSE
 
 $dataCache
 
 $detectClassChanges = FALSE
 
 $reflectedClassNames = array()
 
 $taggedClasses = array()
 
 $classTagsValues = array()
 
 $methodTagsValues = array()
 
 $methodParameters = array()
 
 $classPropertyNames = array()
 
 $classMethodNames = array()
 
 $propertyTagsValues = array()
 
 $ignoredTags = array('package', 'subpackage', 'license', 'copyright', 'author', 'version', 'const')
 
 $dataCacheNeedsUpdate = FALSE
 
 $classSchemata = array()
 
 $configurationManager
 
 $cacheIdentifier
 
 $methodReflections = array()
 

Detailed Description

A backport of the FLOW3 reflection service for aquiring reflection based information. Most of the code is based on the FLOW3 reflection service.

Definition at line 25 of file ReflectionService.php.

Member Function Documentation

◆ buildClassSchema()

◆ convertParameterReflectionToArray()

TYPO3\CMS\Extbase\Reflection\ReflectionService::convertParameterReflectionToArray ( \ReflectionParameter  $parameter,
  $parameterPosition,
\ReflectionMethod  $method = NULL 
)
protected

Converts the given parameter reflection into an information array

Parameters
\ReflectionParameter$parameterThe parameter to reflect
integer$parameterPosition
\ReflectionMethod | NULL$method
Returns
array Parameter information array

Definition at line 467 of file ReflectionService.php.

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

Referenced by TYPO3\CMS\Extbase\Reflection\ReflectionService\getMethodParameters(), and TYPO3\CMS\Extbase\Reflection\ReflectionService\reflectClass().

◆ getClassPropertyNames()

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

Returns the names of all properties of the specified class

Parameters
string$classNameName of the class to return the property names of
Returns
array An array of property names or an empty array if none exist

Definition at line 209 of file ReflectionService.php.

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

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

◆ getClassSchema()

TYPO3\CMS\Extbase\Reflection\ReflectionService::getClassSchema (   $classNameOrObject)

Returns the class schema for the given class

Parameters
mixed$classNameOrObjectThe class name or an object
Returns

Definition at line 222 of file ReflectionService.php.

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

◆ getMethodParameters()

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$classNameName of the class containing the method
string$methodNameName 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

Definition at line 280 of file ReflectionService.php.

References TYPO3\CMS\Extbase\Reflection\ReflectionService\convertParameterReflectionToArray(), and TYPO3\CMS\Extbase\Reflection\ReflectionService\getMethodReflection().

◆ getMethodReflection()

TYPO3\CMS\Extbase\Reflection\ReflectionService::getMethodReflection (   $className,
  $methodName 
)
protected

Returns the Reflection of a method.

Parameters
string$classNameName of the class containing the method
string$methodNameName of the method to return the Reflection for
Returns
the method Reflection object

Definition at line 504 of file ReflectionService.php.

Referenced by TYPO3\CMS\Extbase\Reflection\ReflectionService\getMethodParameters(), TYPO3\CMS\Extbase\Reflection\ReflectionService\getMethodTagsValues(), and TYPO3\CMS\Extbase\Reflection\ReflectionService\hasMethod().

◆ getMethodTagsValues()

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

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

Parameters
string$classNameName of the class containing the method
string$methodNameName 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

Definition at line 259 of file ReflectionService.php.

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

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

◆ getPropertyTagsValues()

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

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

Parameters
string$classNameName of the class containing the property
string$propertyNameName 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

Definition at line 298 of file ReflectionService.php.

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

◆ getPropertyTagValues()

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

Returns the values of the specified class property tag

Parameters
string$classNameName of the class containing the property
string$propertyNameName of the tagged property
string$tagTag to return the values of
Returns
array An array of values or an empty array if the tag was not found

Definition at line 317 of file ReflectionService.php.

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

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

◆ hasMethod()

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

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

Parameters
string$classNameName of the class containing the method
string$methodNameName of the method
Returns
boolean

Definition at line 239 of file ReflectionService.php.

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

◆ initialize()

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

Initializes this service

Exceptions
Exception
Returns
void

Definition at line 172 of file ReflectionService.php.

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

◆ isClassReflected()

TYPO3\CMS\Extbase\Reflection\ReflectionService::isClassReflected (   $className)

Tells if the specified class is known to this reflection service and reflection information is available.

Parameters
string$classNameName of the class
Returns
boolean If the class is reflected by this service

Definition at line 335 of file ReflectionService.php.

◆ isClassTaggedWith()

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

Tells if the specified class is tagged with the given tag

Parameters
string$classNameName of the class
string$tagTag to check for
Returns
boolean TRUE if the class is tagged with $tag, otherwise FALSE

Definition at line 347 of file ReflectionService.php.

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

◆ isInitialized()

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

Returns whether the Reflection Service is initialized.

Returns
boolean true if the Reflection Service is initialized, otherwise false

Definition at line 187 of file ReflectionService.php.

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

◆ isPropertyTaggedWith()

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

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

Parameters
string$classNameName of the class
string$propertyNameName of the property
string$tagTag to check for
Returns
boolean TRUE if the class property is tagged with $tag, otherwise FALSE

Definition at line 369 of file ReflectionService.php.

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

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

◆ loadFromCache()

TYPO3\CMS\Extbase\Reflection\ReflectionService::loadFromCache ( )
protected

Tries to load the reflection data from this service's cache.

Returns
void

Definition at line 517 of file ReflectionService.php.

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

◆ reflectClass()

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

◆ saveToCache()

TYPO3\CMS\Extbase\Reflection\ReflectionService::saveToCache ( )
protected

Exports the internal reflection data into the ReflectionData cache.

Exceptions
Exception
Returns
void

Definition at line 532 of file ReflectionService.php.

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

◆ setDataCache()

TYPO3\CMS\Extbase\Reflection\ReflectionService::setDataCache ( \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend  $dataCache)

Sets the data cache.

The cache must be set before initializing the Reflection Service.

Parameters
\TYPO3\CMS\Core\Cache\Frontend\VariableFrontend$dataCacheCache for the Reflection service
Returns
void

Definition at line 162 of file ReflectionService.php.

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

◆ shutdown()

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

Shuts the Reflection Service down.

Returns
void

Definition at line 196 of file ReflectionService.php.

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

Member Data Documentation

◆ $cacheIdentifier

TYPO3\CMS\Extbase\Reflection\ReflectionService::$cacheIdentifier
protected

Definition at line 145 of file ReflectionService.php.

◆ $classMethodNames

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

Definition at line 101 of file ReflectionService.php.

◆ $classPropertyNames

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

Definition at line 94 of file ReflectionService.php.

◆ $classSchemata

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

Definition at line 134 of file ReflectionService.php.

◆ $classTagsValues

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

Definition at line 72 of file ReflectionService.php.

◆ $configurationManager

TYPO3\CMS\Extbase\Reflection\ReflectionService::$configurationManager
protected

Definition at line 140 of file ReflectionService.php.

◆ $dataCache

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

◆ $dataCacheNeedsUpdate

TYPO3\CMS\Extbase\Reflection\ReflectionService::$dataCacheNeedsUpdate = FALSE
protected

Definition at line 127 of file ReflectionService.php.

◆ $detectClassChanges

TYPO3\CMS\Extbase\Reflection\ReflectionService::$detectClassChanges = FALSE
protected

Definition at line 50 of file ReflectionService.php.

◆ $ignoredTags

TYPO3\CMS\Extbase\Reflection\ReflectionService::$ignoredTags = array('package', 'subpackage', 'license', 'copyright', 'author', 'version', 'const')
protected

Definition at line 115 of file ReflectionService.php.

◆ $initialized

TYPO3\CMS\Extbase\Reflection\ReflectionService::$initialized = FALSE
protected

◆ $methodParameters

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

Definition at line 87 of file ReflectionService.php.

◆ $methodReflections

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

Definition at line 152 of file ReflectionService.php.

◆ $methodTagsValues

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

Definition at line 79 of file ReflectionService.php.

◆ $objectManager

TYPO3\CMS\Extbase\Reflection\ReflectionService::$objectManager
protected

Definition at line 31 of file ReflectionService.php.

◆ $propertyTagsValues

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

Definition at line 108 of file ReflectionService.php.

◆ $reflectedClassNames

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

Definition at line 58 of file ReflectionService.php.

◆ $taggedClasses

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

Definition at line 65 of file ReflectionService.php.