Implements ComplexDataInterface::getPropertyDefinitions().
Overrides ComplexDataInterface::getPropertyDefinitions
public function getPropertyDefinitions() {
// Definitions vary by entity type, so key them by entity type.
$entity_type = $this->definition['settings']['entity type'];
if (!isset(self::$propertyDefinitions[$entity_type])) {
self::$propertyDefinitions[$entity_type]['value'] = array(
// @todo: Lookup the entity type's ID data type and use it here.
'type' => 'integer',
'label' => t('Entity ID'),
);
self::$propertyDefinitions[$entity_type]['entity'] = array(
'type' => 'entity',
'constraints' => array(
'entity type' => $entity_type,
),
'label' => t('Entity'),
'description' => t('The referenced entity'),
// The entity object is computed out of the entity id.
'computed' => TRUE,
'read-only' => FALSE,
'settings' => array(
'id source' => 'value',
),
);
}
return self::$propertyDefinitions[$entity_type];
}