You are here

function entity_property_field_item_image_info in Entity API 7

Defines info for the properties of the image-field item data structure.

1 call to entity_property_field_item_image_info()
entity_metadata_field_image_callback in modules/field.info.inc
Additional callback to adapt the property info for image fields. This callback gets invoked after entity_metadata_field_file_callback().

File

includes/entity.property.inc, line 574
Provides API functions around hook_entity_property_info(). Also see entity.info.inc, which cares for providing entity property info for all core entity types.

Code

function entity_property_field_item_image_info() {
  $properties['file'] = array(
    'type' => 'file',
    'label' => t('The image file.'),
    'getter callback' => 'entity_metadata_field_file_get',
    'setter callback' => 'entity_metadata_field_file_set',
    'required' => TRUE,
  );
  $properties['alt'] = array(
    'type' => 'text',
    'label' => t('The "Alt" attribute text'),
    'setter callback' => 'entity_property_verbatim_set',
  );
  $properties['title'] = array(
    'type' => 'text',
    'label' => t('The "Title" attribute text'),
    'setter callback' => 'entity_property_verbatim_set',
  );
  return $properties;
}