Returns the built and processed entity form for the given entity.
EntityInterface $entity: The entity to be created or edited.
$operation: (optional) The operation identifying the form variation to be returned.
array $form_state: (optional) An associative array containing the current state of the form. Use this to pass additional information to the form, such as the langcode.
$form_state['langcode'] = $langcode;
$form = entity_get_form($entity, 'default', $form_state);
The processed form for the given entity and operation.
function entity_get_form(EntityInterface $entity, $operation = 'default', array $form_state = array()) {
$form_state += entity_form_state_defaults($entity, $operation);
$form_id = $form_state['build_info']['callback_object']
->getFormID();
return drupal_build_form($form_id, $form_state);
}