You are here

class AssetInlineEntityFormController in Asset 7

@file Defines the asset inline entity form controller.

Hierarchy

Expanded class hierarchy of AssetInlineEntityFormController

1 string reference to 'AssetInlineEntityFormController'
asset_entity_info in ./asset.module
Implements hook_entity_info().

File

includes/asset.inline_entity_form.inc, line 8
Defines the asset inline entity form controller.

View source
class AssetInlineEntityFormController extends EntityInlineEntityFormController {

  /**
   * {@inheritdoc}
   */
  public function defaultLabels() {
    $labels = array(
      'singular' => t('asset'),
      'plural' => t('assets'),
    );
    return $labels;
  }

  /**
   * {@inheritdoc}
   */
  public function entityForm($entity_form, &$form_state) {
    $asset = $entity_form['#entity'];
    module_load_include('inc', 'asset', 'includes/asset.admin');
    return asset_base_form($entity_form, $form_state, $asset);
  }

  /**
   * {@inheritdoc}
   */
  public function tableFields($bundles) {
    $fields = parent::tableFields($bundles);
    $info = entity_get_info($this->entityType);
    $metadata = entity_get_property_info($this->entityType);
    $type_key = $info['entity keys']['bundle'];
    $fields[$type_key] = array(
      'type' => 'property',
      'label' => $metadata ? $metadata['properties'][$type_key]['label'] : t('Asset Type'),
      'weight' => 2,
    );
    return $fields;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AssetInlineEntityFormController::defaultLabels public function Returns the default entity type labels. Overrides EntityInlineEntityFormController::defaultLabels
AssetInlineEntityFormController::entityForm public function Returns the entity form to be shown through the IEF widget. Overrides EntityInlineEntityFormController::entityForm
AssetInlineEntityFormController::tableFields public function Returns an array of fields used to represent an entity in the IEF table. Overrides EntityInlineEntityFormController::tableFields
EntityInlineEntityFormController::$entityType protected property
EntityInlineEntityFormController::$settings public property
EntityInlineEntityFormController::createClone public function Creates a clone of the given entity. 2
EntityInlineEntityFormController::css public function Returns an array of css filepaths for the current entity type, keyed by theme name. 1
EntityInlineEntityFormController::defaultSettings public function Returns an array of default settings in the form of key => value. 2
EntityInlineEntityFormController::delete public function Delete permanently saved entities. 1
EntityInlineEntityFormController::entityFormSubmit public function Handles the submission of an entity form. 4
EntityInlineEntityFormController::entityFormValidate public function Validates the entity form. 2
EntityInlineEntityFormController::entityType public function Returns the entity type managed by this controller.
EntityInlineEntityFormController::getSetting public function Returns a setting value.
EntityInlineEntityFormController::labels public function Returns an array of entity type labels fit for display in the UI.
EntityInlineEntityFormController::removeForm public function Returns the remove form to be shown through the IEF widget. 1
EntityInlineEntityFormController::removeFormSubmit public function Handles the submission of a remove form. Decides what should happen to the entity after the removal confirmation.
EntityInlineEntityFormController::save public function Permanently saves the given entity. 2
EntityInlineEntityFormController::settingsForm public function Returns the settings form for the current entity type. 2
EntityInlineEntityFormController::__construct public function 1