You are here

public function BeanInlineEntityFormController::save in Bean (for Drupal 7) 7

Overrides EntityInlineEntityFormController::save().

Overrides EntityInlineEntityFormController::save

File

includes/bean.inline_entity_form.inc, line 252
Defines the inline entity form controller for Nodes.

Class

BeanInlineEntityFormController
@file Defines the inline entity form controller for Nodes.

Code

public function save($entity, $context) {
  if ($this->settings['parent_sync_label'] || $this->settings['parent_sync_title']) {
    $parent_label = entity_label($context['parent_entity_type'], $context['parent_entity']);

    // Set label to the parent label.
    if ($this->settings['parent_sync_label']) {
      $entity->label = $parent_label;
    }

    // Set title to the parent label.
    if ($this->settings['parent_sync_title']) {
      $entity->title = $parent_label;
    }
  }
  bean_save($entity);
}