You are here

public function EntityInlineEntityFormController::entityForm in Inline Entity Form 7

Returns the entity form to be shown through the IEF widget.

When adding data to $form_state it should be noted that there can be several IEF widgets on one master form, each with several form rows, leading to possible key collisions if the keys are not prefixed with $entity_form['#parents'].

Parameters

$entity_form: The entity form.

$form_state: The form state of the parent form.

4 methods override EntityInlineEntityFormController::entityForm()
CommerceLineItemInlineEntityFormController::entityForm in includes/commerce_line_item.inline_entity_form.inc
Overrides EntityInlineEntityFormController::entityForm().
CommerceProductInlineEntityFormController::entityForm in includes/commerce_product.inline_entity_form.inc
Overrides EntityInlineEntityFormController::entityForm().
NodeInlineEntityFormController::entityForm in includes/node.inline_entity_form.inc
Overrides EntityInlineEntityFormController::entityForm().
TaxonomyTermInlineEntityFormController::entityForm in includes/taxonomy_term.inline_entity_form.inc
Overrides EntityInlineEntityFormController::entityForm().

File

includes/entity.inline_entity_form.inc, line 266
Defines the base inline entity form controller.

Class

EntityInlineEntityFormController
@file Defines the base inline entity form controller.

Code

public function entityForm($entity_form, &$form_state) {
  $info = entity_get_info($this->entityType);
  $entity = $entity_form['#entity'];
  if (!empty($info['fieldable'])) {
    $langcode = entity_language($this->entityType, $entity);
    field_attach_form($this->entityType, $entity, $entity_form, $form_state, $langcode);
  }
  return $entity_form;
}