You are here

function video_embed_field_data_property_info in Video Embed Field 7.2

Defines info for the properties of the video_embed_field data structure.

2 calls to video_embed_field_data_property_info()
video_embed_field_field_views_data in views/video_embed_field.views.inc
Implements hook_field_views_data().
video_embed_field_property_info_callback in ./video_embed_field.field.inc
Property callback for the Entity Metadata framework.

File

./video_embed_field.field.inc, line 49
Implement a video field.

Code

function video_embed_field_data_property_info($name = NULL) {

  // Build an array of basic property information for video_embed_field.
  $properties = array(
    'video_url' => array(
      'label' => 'Video URL',
      'type' => 'uri',
      'setter callback' => 'entity_property_verbatim_set',
    ),
    'thumbnail_path' => array(
      'label' => 'Thumbnail path',
      'type' => 'uri',
      'getter callback' => 'entity_property_verbatim_get_url',
    ),
    'description' => array(
      'label' => 'Description',
      'type' => 'text',
      'setter callback' => 'entity_property_verbatim_set',
    ),
  );

  // Add the default values for each of the video_embed_field properties.
  foreach ($properties as $key => &$value) {
    $value += array(
      'description' => !empty($name) ? t('!label of field %name', array(
        '!label' => $value['label'],
        '%name' => $name,
      )) : '',
    );
  }
  return $properties;
}