TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Extbase\Reflection\ClassSchema Class Reference

Public Member Functions

 __construct ($className)
 
 getClassName ()
 
 addProperty ($name, $type, $lazy=false, $cascade='')
 
 getProperty ($propertyName)
 
 getProperties ()
 
 setModelType ($modelType)
 
 getModelType ()
 
 setAggregateRoot ($isRoot)
 
 isAggregateRoot ()
 
 hasProperty ($propertyName)
 
 setUuidPropertyName ($propertyName)
 
 getUuidPropertyName ()
 
 markAsIdentityProperty ($propertyName)
 
 getIdentityProperties ()
 

Public Attributes

const MODELTYPE_ENTITY = 1
 
const MODELTYPE_VALUEOBJECT = 2
 

Protected Attributes

 $className
 
 $modelType = self::MODELTYPE_ENTITY
 
 $aggregateRoot = false
 
 $uuidPropertyName
 
 $properties = []
 
 $identityProperties = []
 

Detailed Description

A class schema

http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later

Definition at line 24 of file ClassSchema.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Extbase\Reflection\ClassSchema::__construct (   $className)

Constructs this class schema

Parameters
string$classNameName of the class this schema is referring to

Definition at line 79 of file ClassSchema.php.

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

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$nameName of the property
string$typeType of the property
bool$lazyWhether the property should be lazy-loaded when reconstituting
string$cascadeStrategy to cascade the object graph.
Returns
void

Definition at line 103 of file ClassSchema.php.

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

◆ getClassName()

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

Returns the class name this schema is referring to

Returns
string The class name

Definition at line 89 of file ClassSchema.php.

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

◆ getIdentityProperties()

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

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

Returns
array
See also
markAsIdentityProperty()

Definition at line 246 of file ClassSchema.php.

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

◆ getModelType()

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.

Definition at line 156 of file ClassSchema.php.

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

◆ getProperties()

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

Returns all properties defined in this schema

Returns
array

Definition at line 131 of file ClassSchema.php.

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

◆ getProperty()

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 121 of file ClassSchema.php.

◆ getUuidPropertyName()

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

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

Returns
string

Definition at line 215 of file ClassSchema.php.

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

◆ hasProperty()

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

If the class schema has a certain property.

Parameters
string$propertyNameName of the property
Returns
bool

Definition at line 190 of file ClassSchema.php.

◆ isAggregateRoot()

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 179 of file ClassSchema.php.

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

◆ 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 229 of file ClassSchema.php.

◆ 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$isRootTRUE if it is the root of an aggregate
Returns
void

Definition at line 168 of file ClassSchema.php.

◆ setModelType()

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

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

Parameters
int$modelTypeThe model type, one of the MODELTYPE_* constants.
Exceptions

Definition at line 143 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

Parameters
string$propertyName
Exceptions

Definition at line 202 of file ClassSchema.php.

Member Data Documentation

◆ $aggregateRoot

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

◆ $className

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

◆ $identityProperties

TYPO3\CMS\Extbase\Reflection\ClassSchema::$identityProperties = []
protected

◆ $modelType

TYPO3\CMS\Extbase\Reflection\ClassSchema::$modelType = self::MODELTYPE_ENTITY
protected

◆ $properties

TYPO3\CMS\Extbase\Reflection\ClassSchema::$properties = []
protected

◆ $uuidPropertyName

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

◆ MODELTYPE_ENTITY

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

Available model types

Definition at line 29 of file ClassSchema.php.

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

◆ MODELTYPE_VALUEOBJECT

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