TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Extbase\Reflection\ClassSchema Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Reflection\ClassSchema:
Tx_Extbase_Reflection_ClassSchema

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 = array()
 
 $identityProperties = array()
 
 $typeHandlingService
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! A class schema

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

Definition at line 21 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 82 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
boolean$lazyWhether the property should be lazy-loaded when reconstituting
string$cascadeStrategy to cascade the object graph.
Returns
void

Definition at line 104 of file ClassSchema.php.

◆ getClassName()

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

Returns the class name this schema is referring to

Returns
string The class name

Definition at line 91 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 236 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
integer The model type, one of the MODELTYPE_* constants.

Definition at line 153 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 130 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 207 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
boolean

Definition at line 184 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
boolean TRUE if it is managed

Definition at line 174 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 220 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
boolean$isRootTRUE if it is the root of an aggregate
Returns
void

Definition at line 164 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
integer$modelTypeThe model type, one of the MODELTYPE_* constants.
Exceptions

Definition at line 141 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 195 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 = array()
protected

◆ $modelType

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

◆ $properties

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

◆ $typeHandlingService

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

Definition at line 75 of file ClassSchema.php.

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

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

◆ MODELTYPE_VALUEOBJECT

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