‪TYPO3CMS  9.5
TYPO3\CMS\Extbase\Reflection\ClassSchema Class Reference

Public Member Functions

 __construct ($className)
 
string getClassName ()
 
 addProperty ($name, $type, $lazy=false, $cascade='')
 
array getProperty ($propertyName)
 
array getProperties ()
 
 setModelType ($modelType)
 
int getModelType ()
 
 setAggregateRoot ($isRoot)
 
bool isAggregateRoot ()
 
bool hasProperty ($propertyName)
 
 setUuidPropertyName ($propertyName)
 
string getUuidPropertyName ()
 
 markAsIdentityProperty ($propertyName)
 
array getIdentityProperties ()
 
bool hasConstructor ()
 
array getMethod (string $name)
 
array getMethods ()
 
bool isModel ()
 
bool isEntity ()
 
bool isValueObject ()
 
bool isSingleton ()
 
bool hasMethod (string $methodName)
 
array getTags ()
 
bool hasInjectProperties ()
 
bool hasInjectMethods ()
 
array getInjectMethods ()
 
array getInjectProperties ()
 
array getConstructorArguments ()
 

Public Attributes

const MODELTYPE_ENTITY = 1
 
const MODELTYPE_VALUEOBJECT = 2
 

Protected Member Functions

 reflectProperties (\ReflectionClass $reflectionClass)
 
 reflectMethods (\ReflectionClass $reflectionClass)
 
bool hasInjectMethodName (\ReflectionMethod $reflectionMethod)
 

Protected Attributes

string $className
 
int $modelType = 0
 
bool $aggregateRoot = false
 
string $uuidPropertyName
 
array $properties = array( )
 
array $identityProperties = array( )
 

Private Attributes

bool $isSingleton
 
bool $isController
 
array $methods
 
array $tags
 
array $injectProperties = array( )
 
array $injectMethods = array( )
 

Detailed Description

A class schema

only to be used within Extbase, not part of TYPO3 Core API.

Definition at line 40 of file ClassSchema.php.

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ addProperty()

TYPO3\CMS\Extbase\Reflection\ClassSchema::addProperty (   $name,
  $type,
  $lazy = false,
  $cascade = '' 
)

Adds (defines) a specific property and its type.

Parameters
string$name‪Name of the property
string$type‪Type of the property
bool$lazy‪Whether the property should be lazy-loaded when reconstituting
string$cascade‪Strategy to cascade the object graph.
Deprecated:
‪since TYPO3 v9, will be removed in TYPO3 v10.0.

Definition at line 602 of file ClassSchema.php.

References TYPO3\CMS\Extbase\Utility\TypeHandlingUtility\parseType().

◆ getClassName()

string TYPO3\CMS\Extbase\Reflection\ClassSchema::getClassName ( )

Returns the class name this schema is referring to

Returns
‪string The class name

Definition at line 588 of file ClassSchema.php.

References TYPO3\CMS\Extbase\Reflection\ClassSchema\$className.

Referenced by TYPO3\CMS\Extbase\Object\Container\Container\injectDependencies(), and TYPO3\CMS\Extbase\Object\Container\Container\instanciateObject().

◆ getConstructorArguments()

array TYPO3\CMS\Extbase\Reflection\ClassSchema::getConstructorArguments ( )

◆ getIdentityProperties()

array TYPO3\CMS\Extbase\Reflection\ClassSchema::getIdentityProperties ( )

Gets the properties (names and types) forming the identity of an object.

Returns
‪array
See also
markAsIdentityProperty()
Deprecated:
‪since TYPO3 v9, will be removed in TYPO3 v10.0.

Definition at line 773 of file ClassSchema.php.

References TYPO3\CMS\Extbase\Reflection\ClassSchema\$identityProperties.

◆ getInjectMethods()

array TYPO3\CMS\Extbase\Reflection\ClassSchema::getInjectMethods ( )

◆ getInjectProperties()

array TYPO3\CMS\Extbase\Reflection\ClassSchema::getInjectProperties ( )
Returns
‪array

Definition at line 911 of file ClassSchema.php.

References TYPO3\CMS\Extbase\Reflection\ClassSchema\$injectProperties.

◆ getMethod()

array TYPO3\CMS\Extbase\Reflection\ClassSchema::getMethod ( string  $name)
Parameters
string$name
Returns
‪array

Definition at line 794 of file ClassSchema.php.

◆ getMethods()

array TYPO3\CMS\Extbase\Reflection\ClassSchema::getMethods ( )
Returns
‪array

Definition at line 802 of file ClassSchema.php.

References TYPO3\CMS\Extbase\Reflection\ClassSchema\$methods.

◆ getModelType()

int TYPO3\CMS\Extbase\Reflection\ClassSchema::getModelType ( )

Returns the model type of the class this schema is referring to.

Returns
‪int The model type, one of the MODELTYPE_* constants.
Deprecated:
‪since TYPO3 v9, will be removed in TYPO3 v10.0.

Definition at line 666 of file ClassSchema.php.

References TYPO3\CMS\Extbase\Reflection\ClassSchema\$modelType.

◆ getProperties()

array TYPO3\CMS\Extbase\Reflection\ClassSchema::getProperties ( )

Returns all properties defined in this schema

Returns
‪array

Definition at line 636 of file ClassSchema.php.

References TYPO3\CMS\Extbase\Reflection\ClassSchema\$properties.

◆ getProperty()

array TYPO3\CMS\Extbase\Reflection\ClassSchema::getProperty (   $propertyName)

Returns the given property defined in this schema. Check with hasProperty($propertyName) before!

Parameters
string$propertyName
Returns
‪array

Definition at line 624 of file ClassSchema.php.

◆ getTags()

array TYPO3\CMS\Extbase\Reflection\ClassSchema::getTags ( )
Returns
‪array

Definition at line 874 of file ClassSchema.php.

References TYPO3\CMS\Extbase\Reflection\ClassSchema\$tags.

◆ getUuidPropertyName()

string TYPO3\CMS\Extbase\Reflection\ClassSchema::getUuidPropertyName ( )

Gets the name of the property marked as uuid of an object

Returns
‪string
Deprecated:
‪since TYPO3 v9, will be removed in TYPO3 v10.0.

Definition at line 733 of file ClassSchema.php.

References TYPO3\CMS\Extbase\Reflection\ClassSchema\$uuidPropertyName.

◆ hasConstructor()

bool TYPO3\CMS\Extbase\Reflection\ClassSchema::hasConstructor ( )
Returns
‪bool

Definition at line 785 of file ClassSchema.php.

Referenced by TYPO3\CMS\Extbase\Reflection\ClassSchema\getConstructorArguments().

◆ hasInjectMethodName()

bool TYPO3\CMS\Extbase\Reflection\ClassSchema::hasInjectMethodName ( \ReflectionMethod  $reflectionMethod)
protected
Parameters
\ReflectionMethod$reflectionMethod
Returns
‪bool

Definition at line 811 of file ClassSchema.php.

Referenced by TYPO3\CMS\Extbase\Reflection\ClassSchema\reflectMethods().

◆ hasInjectMethods()

bool TYPO3\CMS\Extbase\Reflection\ClassSchema::hasInjectMethods ( )
Returns
‪bool

Definition at line 890 of file ClassSchema.php.

Referenced by TYPO3\CMS\Extbase\Object\Container\Container\injectDependencies().

◆ hasInjectProperties()

bool TYPO3\CMS\Extbase\Reflection\ClassSchema::hasInjectProperties ( )
Returns
‪bool

Definition at line 882 of file ClassSchema.php.

Referenced by TYPO3\CMS\Extbase\Object\Container\Container\injectDependencies().

◆ hasMethod()

bool TYPO3\CMS\Extbase\Reflection\ClassSchema::hasMethod ( string  $methodName)
Parameters
string$methodName
Returns
‪bool

Definition at line 866 of file ClassSchema.php.

◆ hasProperty()

bool TYPO3\CMS\Extbase\Reflection\ClassSchema::hasProperty (   $propertyName)

If the class schema has a certain property.

Parameters
string$propertyName‪Name of the property
Returns
‪bool

Definition at line 703 of file ClassSchema.php.

◆ isAggregateRoot()

bool TYPO3\CMS\Extbase\Reflection\ClassSchema::isAggregateRoot ( )

Whether the class is an aggregate root and therefore accessible through a repository.

Returns
‪bool TRUE if it is managed

Definition at line 692 of file ClassSchema.php.

References TYPO3\CMS\Extbase\Reflection\ClassSchema\$aggregateRoot.

◆ isEntity()

bool TYPO3\CMS\Extbase\Reflection\ClassSchema::isEntity ( )
Returns
‪bool

Definition at line 840 of file ClassSchema.php.

Referenced by TYPO3\CMS\Extbase\Reflection\ClassSchema\isModel().

◆ isModel()

bool TYPO3\CMS\Extbase\Reflection\ClassSchema::isModel ( )

◆ isSingleton()

◆ isValueObject()

bool TYPO3\CMS\Extbase\Reflection\ClassSchema::isValueObject ( )
Returns
‪bool

Definition at line 849 of file ClassSchema.php.

Referenced by TYPO3\CMS\Extbase\Reflection\ClassSchema\isModel().

◆ markAsIdentityProperty()

TYPO3\CMS\Extbase\Reflection\ClassSchema::markAsIdentityProperty (   $propertyName)

Marks the given property as one of properties forming the identity of an object. The property must already be registered in the class schema.

Parameters
string$propertyName
Exceptions

Definition at line 751 of file ClassSchema.php.

Referenced by TYPO3\CMS\Extbase\Reflection\ClassSchema\reflectProperties().

◆ reflectMethods()

TYPO3\CMS\Extbase\Reflection\ClassSchema::reflectMethods ( \ReflectionClass  $reflectionClass)
protected

◆ reflectProperties()

TYPO3\CMS\Extbase\Reflection\ClassSchema::reflectProperties ( \ReflectionClass  $reflectionClass)
protected

◆ setAggregateRoot()

TYPO3\CMS\Extbase\Reflection\ClassSchema::setAggregateRoot (   $isRoot)

Marks the class if it is root of an aggregate and therefore accessible through a repository - or not.

Parameters
bool$isRoot‪TRUE if it is the root of an aggregate

Definition at line 681 of file ClassSchema.php.

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

◆ setModelType()

TYPO3\CMS\Extbase\Reflection\ClassSchema::setModelType (   $modelType)

Sets the model type of the class this schema is referring to.

Parameters
int$modelType‪The model type, one of the MODELTYPE_* constants.
Exceptions

Definition at line 648 of file ClassSchema.php.

References TYPO3\CMS\Extbase\Reflection\ClassSchema\$modelType.

◆ setUuidPropertyName()

TYPO3\CMS\Extbase\Reflection\ClassSchema::setUuidPropertyName (   $propertyName)

Sets the property marked as uuid of an object with @uuid

Parameters
string$propertyName
Exceptions

Definition at line 715 of file ClassSchema.php.

Referenced by TYPO3\CMS\Extbase\Reflection\ClassSchema\reflectProperties().

Member Data Documentation

◆ $aggregateRoot

bool TYPO3\CMS\Extbase\Reflection\ClassSchema::$aggregateRoot = false
protected

Whether a repository exists for the class this schema is referring to

Definition at line 64 of file ClassSchema.php.

Referenced by TYPO3\CMS\Extbase\Reflection\ClassSchema\isAggregateRoot().

◆ $className

string TYPO3\CMS\Extbase\Reflection\ClassSchema::$className
protected

Name of the class this schema is referring to

Definition at line 52 of file ClassSchema.php.

Referenced by TYPO3\CMS\Extbase\Reflection\ClassSchema\__construct(), and TYPO3\CMS\Extbase\Reflection\ClassSchema\getClassName().

◆ $identityProperties

array TYPO3\CMS\Extbase\Reflection\ClassSchema::$identityProperties = array( )
protected

The properties forming the identity of an object

Definition at line 82 of file ClassSchema.php.

Referenced by TYPO3\CMS\Extbase\Reflection\ClassSchema\getIdentityProperties().

◆ $injectMethods

array TYPO3\CMS\Extbase\Reflection\ClassSchema::$injectMethods = array( )
private

◆ $injectProperties

array TYPO3\CMS\Extbase\Reflection\ClassSchema::$injectProperties = array( )
private

◆ $isController

bool TYPO3\CMS\Extbase\Reflection\ClassSchema::$isController
private

Definition at line 92 of file ClassSchema.php.

◆ $isSingleton

bool TYPO3\CMS\Extbase\Reflection\ClassSchema::$isSingleton
private

Indicates if the class is a singleton or not.

Definition at line 88 of file ClassSchema.php.

Referenced by TYPO3\CMS\Extbase\Reflection\ClassSchema\isSingleton().

◆ $methods

array TYPO3\CMS\Extbase\Reflection\ClassSchema::$methods
private

Definition at line 96 of file ClassSchema.php.

Referenced by TYPO3\CMS\Extbase\Reflection\ClassSchema\getMethods().

◆ $modelType

int TYPO3\CMS\Extbase\Reflection\ClassSchema::$modelType = 0
protected

Model type of the class this schema is referring to

Definition at line 58 of file ClassSchema.php.

Referenced by TYPO3\CMS\Extbase\Reflection\ClassSchema\getModelType(), and TYPO3\CMS\Extbase\Reflection\ClassSchema\setModelType().

◆ $properties

array TYPO3\CMS\Extbase\Reflection\ClassSchema::$properties = array( )
protected

Properties of the class which need to be persisted

Definition at line 76 of file ClassSchema.php.

Referenced by TYPO3\CMS\Extbase\Reflection\ClassSchema\getProperties().

◆ $tags

array TYPO3\CMS\Extbase\Reflection\ClassSchema::$tags
private

Definition at line 100 of file ClassSchema.php.

Referenced by TYPO3\CMS\Extbase\Reflection\ClassSchema\getTags().

◆ $uuidPropertyName

string TYPO3\CMS\Extbase\Reflection\ClassSchema::$uuidPropertyName
protected

The name of the property holding the uuid of an entity, if any.

Definition at line 70 of file ClassSchema.php.

Referenced by TYPO3\CMS\Extbase\Reflection\ClassSchema\getUuidPropertyName().

◆ MODELTYPE_ENTITY

const TYPO3\CMS\Extbase\Reflection\ClassSchema::MODELTYPE_ENTITY = 1

Available model types

Definition at line 45 of file ClassSchema.php.

◆ MODELTYPE_VALUEOBJECT

const TYPO3\CMS\Extbase\Reflection\ClassSchema::MODELTYPE_VALUEOBJECT = 2

Definition at line 46 of file ClassSchema.php.