Implements \Drupal\Core\TypedData\ComplexDataInterface::getPropertyDefinitions().
Overrides Map::getPropertyDefinitions
public function getPropertyDefinitions() {
if (!isset(static::$propertyDefinitions)) {
static::$propertyDefinitions['fid'] = array(
'type' => 'integer',
'label' => t('Referenced file id.'),
);
static::$propertyDefinitions['alt'] = array(
'type' => 'boolean',
'label' => t("Alternative image text, for the image's 'alt' attribute."),
);
static::$propertyDefinitions['title'] = array(
'type' => 'string',
'label' => t("Image title text, for the image's 'title' attribute."),
);
static::$propertyDefinitions['width'] = array(
'type' => 'integer',
'label' => t('The width of the image in pixels.'),
);
static::$propertyDefinitions['height'] = array(
'type' => 'integer',
'label' => t('The height of the image in pixels.'),
);
static::$propertyDefinitions['entity'] = array(
'type' => 'entity',
'constraints' => array(
'EntityType' => 'file',
),
'label' => t('Image'),
'description' => t('The referenced file'),
// The entity object is computed out of the fid.
'computed' => TRUE,
'read-only' => FALSE,
'settings' => array(
'id source' => 'fid',
),
);
}
return static::$propertyDefinitions;
}