You are here

protected function PostForm::setFormMode in Open Social 8

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_post/src/Form/PostForm.php \Drupal\social_post\Form\PostForm::setFormMode()
  2. 8.2 modules/social_features/social_post/src/Form/PostForm.php \Drupal\social_post\Form\PostForm::setFormMode()
  3. 8.3 modules/social_features/social_post/src/Form/PostForm.php \Drupal\social_post\Form\PostForm::setFormMode()
  4. 8.4 modules/social_features/social_post/src/Form/PostForm.php \Drupal\social_post\Form\PostForm::setFormMode()
  5. 8.5 modules/social_features/social_post/src/Form/PostForm.php \Drupal\social_post\Form\PostForm::setFormMode()
  6. 8.6 modules/social_features/social_post/src/Form/PostForm.php \Drupal\social_post\Form\PostForm::setFormMode()
  7. 8.7 modules/social_features/social_post/src/Form/PostForm.php \Drupal\social_post\Form\PostForm::setFormMode()
  8. 8.8 modules/social_features/social_post/src/Form/PostForm.php \Drupal\social_post\Form\PostForm::setFormMode()
  9. 10.3.x modules/social_features/social_post/src/Form/PostForm.php \Drupal\social_post\Form\PostForm::setFormMode()
  10. 10.0.x modules/social_features/social_post/src/Form/PostForm.php \Drupal\social_post\Form\PostForm::setFormMode()
  11. 10.1.x modules/social_features/social_post/src/Form/PostForm.php \Drupal\social_post\Form\PostForm::setFormMode()
  12. 10.2.x modules/social_features/social_post/src/Form/PostForm.php \Drupal\social_post\Form\PostForm::setFormMode()

Function to set the current form modes.

Retrieve the form display before it is overwritten in the parent.

2 calls to PostForm::setFormMode()
PostForm::buildForm in modules/social_features/social_post/src/Form/PostForm.php
Form constructor.
PostForm::save in modules/social_features/social_post/src/Form/PostForm.php
Form submission handler for the 'save' action.

File

modules/social_features/social_post/src/Form/PostForm.php, line 238

Class

PostForm
Form controller for Post edit forms.

Namespace

Drupal\social_post\Form

Code

protected function setFormMode() {
  if ($this
    ->getBundleEntity() !== NULL) {
    $bundle = $this
      ->getBundleEntity()
      ->id();

    // Set as variables, since the bundle might be different.
    $this->postViewDefault = 'post.' . $bundle . '.default';
    $this->postViewProfile = 'post.' . $bundle . '.profile';
    $this->postViewGroup = 'post.' . $bundle . '.group';
  }
}