Drupal 8  8.0.2
EntityDataDefinition Class Reference
Inheritance diagram for EntityDataDefinition:

Public Member Functions

 getPropertyDefinitions ()
 
 getDataType ()
 
 getEntityTypeId ()
 
 setEntityTypeId ($entity_type_id)
 
 getBundles ()
 
 setBundles (array $bundles=NULL)
 
- Public Member Functions inherited from ComplexDataDefinitionBase
 getPropertyDefinitions ()
 
 getPropertyDefinition ($name)
 
 getMainPropertyName ()
 
 __sleep ()
 
- Public Member Functions inherited from DataDefinition
 __construct (array $values=array())
 
 getDataType ()
 
 setDataType ($type)
 
 getLabel ()
 
 setLabel ($label)
 
 getDescription ()
 
 setDescription ($description)
 
 isList ()
 
 isReadOnly ()
 
 setReadOnly ($read_only)
 
 isComputed ()
 
 setComputed ($computed)
 
 isRequired ()
 
 setRequired ($required)
 
 getClass ()
 
 setClass ($class)
 
 getSettings ()
 
 setSettings (array $settings)
 
 getSetting ($setting_name)
 
 setSetting ($setting_name, $value)
 
 getConstraints ()
 
 getConstraint ($constraint_name)
 
 setConstraints (array $constraints)
 
 addConstraint ($constraint_name, $options=NULL)
 
 offsetExists ($offset)
 
offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
 toArray ()
 

Static Public Member Functions

static create ($entity_type_id=NULL)
 
static createFromDataType ($data_type)
 
- Static Public Member Functions inherited from DataDefinition
static create ($type)
 
static createFromDataType ($type)
 

Additional Inherited Members

- Protected Attributes inherited from ComplexDataDefinitionBase
 $propertyDefinitions
 
- Protected Attributes inherited from DataDefinition
 $definition = array()
 

Detailed Description

A typed data definition class for describing entities.

Member Function Documentation

static create (   $entity_type_id = NULL)
static

Creates a new entity definition.

Parameters
string$entity_type_id(optional) The ID of the entity type, or NULL if the entity type is unknown. Defaults to NULL.
Returns
static

Referenced by EntityAdapter\createFromEntity(), EntityFieldTest\doTestIntrospection(), EntityReferenceItem\propertyDefinitions(), and EntityTypedDataDefinitionTest\testEntities().

Here is the caller graph for this function:

static createFromDataType (   $data_type)
static

{Creates a new data definition object.This method is typically used by ::createDataDefinition() to build a definition object for an arbitrary data type. When the definition class is known, it is recommended to directly use the static create() method on that class instead; e.g.:

Parameters
string$data_typeThe data type, for which a data definition should be created.
Returns
static
Exceptions
\InvalidArgumentExceptionIf an unsupported data type gets passed to the class; e.g., 'string' to a definition class handling 'entity:* data types.
}

Implements DataDefinitionInterface.

getBundles ( )

{Gets the array of possible entity bundles.

Returns
array|null The array of possible bundles, or NULL for any.
}

Implements EntityDataDefinitionInterface.

Referenced by EntityDataDefinition\getDataType(), and EntityDataDefinition\getPropertyDefinitions().

Here is the caller graph for this function:

getDataType ( )

{Returns the data type of the data.

Returns
string The data type.
}

Implements DataDefinitionInterface.

References EntityDataDefinition\getBundles(), and EntityDataDefinition\getEntityTypeId().

Here is the call graph for this function:

getEntityTypeId ( )

{Gets the entity type ID.

Returns
string|null The entity type ID, or NULL if the entity type is unknown.
}

Implements EntityDataDefinitionInterface.

Referenced by EntityDataDefinition\getDataType(), and EntityDataDefinition\getPropertyDefinitions().

Here is the caller graph for this function:

getPropertyDefinitions ( )

{Gets an array of property definitions of contained properties.

Returns
[] An array of property definitions of contained properties, keyed by property name.
}

Implements ComplexDataDefinitionInterface.

References Drupal\entityManager(), EntityDataDefinition\getBundles(), and EntityDataDefinition\getEntityTypeId().

Here is the call graph for this function:

setBundles ( array  $bundles = NULL)

{Sets the array of possible entity bundles.

Parameters
array | null$bundlesThe array of possible bundles, or NULL for any.
Returns
$this
}

Implements EntityDataDefinitionInterface.

References DataDefinition\addConstraint().

Here is the call graph for this function:

setEntityTypeId (   $entity_type_id)

{Sets the entity type ID.

Parameters
string$entity_type_idThe entity type to set.
Returns
$this
}

Implements EntityDataDefinitionInterface.

References DataDefinition\addConstraint().

Here is the call graph for this function:


The documentation for this class was generated from the following file: