You are here

class ParagraphsItemMetadataController in Paragraphs 7

Entity metadata implementation for the paragraphs entity.

Hierarchy

Expanded class hierarchy of ParagraphsItemMetadataController

1 string reference to 'ParagraphsItemMetadataController'
paragraphs_entity_info in ./paragraphs.module
Implements hook_entity_info().

File

./ParagraphsItemMetadataController.inc, line 6

View source
class ParagraphsItemMetadataController extends EntityDefaultMetadataController {

  /**
   * Generate basic metadata for a paragraphs item.
   */
  public function entityPropertyInfo() {
    $info = parent::entityPropertyInfo();
    $properties =& $info['paragraphs_item']['properties'];
    $properties['field_name']['label'] = t('Field name');
    $properties['field_name']['description'] = t('The machine-readable name of the paragraphs field containing this item.');
    $properties['field_name']['required'] = TRUE;
    $properties['host_entity'] = array(
      'label' => t('Host entity'),
      'type' => 'entity',
      'description' => t('The entity containing the paragraphs field.'),
      'getter callback' => 'paragraphs_item_get_host_entity',
      'setter callback' => 'paragraphs_item_set_host_entity',
      'required' => TRUE,
    );
    return $info;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EntityDefaultMetadataController::$type protected property
EntityDefaultMetadataController::bundleOptionsList public static function A options list callback returning all bundles for an entity type.
EntityDefaultMetadataController::convertSchema protected function Return a set of properties for an entity based on the schema definition
EntityDefaultMetadataController::__construct public function
ParagraphsItemMetadataController::entityPropertyInfo public function Generate basic metadata for a paragraphs item. Overrides EntityDefaultMetadataController::entityPropertyInfo