You are here

protected function GroupContentTypeForm::getContentPlugin in Group 8

Returns the configurable plugin for the group content type.

Return value

\Drupal\group\Plugin\GroupContentEnablerInterface The configurable group content enabler plugin.

3 calls to GroupContentTypeForm::getContentPlugin()
GroupContentTypeForm::form in src/Entity/Form/GroupContentTypeForm.php
Gets the actual form array to be built.
GroupContentTypeForm::submitForm in src/Entity/Form/GroupContentTypeForm.php
This is the default entity object builder function. It is called before any other submit handler to build the new entity object to be used by the following submit handlers. At this point of the form workflow the entity is validated and the form state…
GroupContentTypeForm::validateForm in src/Entity/Form/GroupContentTypeForm.php
Form validation handler.

File

src/Entity/Form/GroupContentTypeForm.php, line 48

Class

GroupContentTypeForm
Form controller for group content type forms.

Namespace

Drupal\group\Entity\Form

Code

protected function getContentPlugin() {

  /** @var \Drupal\group\Entity\GroupContentTypeInterface $group_content_type */
  $group_content_type = $this
    ->getEntity();
  $group_type = $group_content_type
    ->getGroupType();

  // Initialize an empty plugin so we can show a default configuration form.
  if ($this->operation == 'add') {
    $plugin_id = $group_content_type
      ->getContentPluginId();
    $configuration['group_type_id'] = $group_type
      ->id();
    return $this->pluginManager
      ->createInstance($plugin_id, $configuration);
  }
  else {
    return $group_content_type
      ->getContentPlugin();
  }
}