TYPO3  7.6
Public Member Functions | Public Attributes | Protected Attributes | List of all members
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 = array()
 
 $identityProperties = array()
 

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 (   $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 ClassSchema\$className.

Member Function Documentation

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 TypeHandlingUtility\parseType().

getClassName ( )

Returns the class name this schema is referring to

Returns
string The class name

Definition at line 89 of file ClassSchema.php.

References ClassSchema\$className.

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 ClassSchema\$identityProperties.

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 ClassSchema\$modelType.

getProperties ( )

Returns all properties defined in this schema

Returns
array

Definition at line 131 of file ClassSchema.php.

References ClassSchema\$properties.

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 ( )

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

Returns
string

Definition at line 215 of file ClassSchema.php.

References ClassSchema\$uuidPropertyName.

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 ( )

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 ClassSchema\$aggregateRoot.

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
\InvalidArgumentException
Returns
void

Definition at line 229 of file ClassSchema.php.

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 (   $modelType)

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

Parameters
int$modelTypeThe model type, one of the MODELTYPE_* constants.
Exceptions
\InvalidArgumentException
Returns
void

Definition at line 143 of file ClassSchema.php.

References ClassSchema\$modelType.

setUuidPropertyName (   $propertyName)

Sets the property marked as uuid of an object with

Parameters
string$propertyName
Exceptions
\InvalidArgumentException
Returns
void

Definition at line 202 of file ClassSchema.php.

Member Data Documentation

$aggregateRoot = false
protected

Definition at line 51 of file ClassSchema.php.

Referenced by ClassSchema\isAggregateRoot().

$className
protected

Definition at line 37 of file ClassSchema.php.

Referenced by ClassSchema\__construct(), and ClassSchema\getClassName().

$identityProperties = array()
protected

Definition at line 72 of file ClassSchema.php.

Referenced by ClassSchema\getIdentityProperties().

$modelType = self::MODELTYPE_ENTITY
protected

Definition at line 44 of file ClassSchema.php.

Referenced by ClassSchema\getModelType(), and ClassSchema\setModelType().

$properties = array()
protected

Definition at line 65 of file ClassSchema.php.

Referenced by ClassSchema\getProperties().

$uuidPropertyName
protected

Definition at line 58 of file ClassSchema.php.

Referenced by ClassSchema\getUuidPropertyName().

const MODELTYPE_ENTITY = 1

Available model types

Definition at line 29 of file ClassSchema.php.

Referenced by ReflectionService\buildClassSchema().

const MODELTYPE_VALUEOBJECT = 2

Definition at line 30 of file ClassSchema.php.

Referenced by ReflectionService\buildClassSchema().