You are here

class GroupContentEnabler in Group 8

Defines a GroupContentEnabler annotation object.

Plugin Namespace: Plugin\GroupContentEnabler

For a working example, see \Drupal\group\Plugin\GroupContentEnabler\GroupMembership

Hierarchy

Expanded class hierarchy of GroupContentEnabler

See also

\Drupal\group\Plugin\GroupContentEnablerInterface

\Drupal\group\Plugin\GroupContentEnablerManager

Plugin API

6 classes are annotated with GroupContentEnabler
EntityTestAsContent in tests/modules/group_test_plugin/src/Plugin/GroupContentEnabler/EntityTestAsContent.php
Provides a content enabler for test entities.
GroupAsContent in tests/modules/group_test_plugin/src/Plugin/GroupContentEnabler/GroupAsContent.php
Provides a content enabler for groups.
GroupMembership in src/Plugin/GroupContentEnabler/GroupMembership.php
Provides a content enabler for users.
GroupNode in modules/gnode/src/Plugin/GroupContentEnabler/GroupNode.php
Provides a content enabler for nodes.
NodeAsContent in tests/modules/group_test_plugin/src/Plugin/GroupContentEnabler/NodeAsContent.php
Provides a content enabler for nodes.

... See full list

File

src/Annotation/GroupContentEnabler.php, line 21

Namespace

Drupal\group\Annotation
View source
class GroupContentEnabler extends Plugin {

  /**
   * The plugin ID.
   *
   * @var string
   */
  public $id;

  /**
   * The human-readable name of the GroupContentEnabler plugin.
   *
   * @var \Drupal\Core\Annotation\Translation
   *
   * @ingroup plugin_translatable
   */
  public $label;

  /**
   * A short description of the GroupContentEnabler plugin.
   *
   * @var \Drupal\Core\Annotation\Translation
   *
   * @ingroup plugin_translatable
   */
  public $description;

  /**
   * The ID of the entity type you want to enable as group content.
   *
   * @var string
   */
  public $entity_type_id;

  /**
   * (optional) The bundle of the entity type you want to enable as group content.
   *
   * Do not specify if your plugin manages all bundles.
   *
   * @var string|false
   */
  public $entity_bundle = FALSE;

  /**
   * (optional) Whether the plugin defines entity access.
   *
   * This controls whether you can create entities within the group (TRUE) or
   * only add existing ones (FALSE). It also generates the necessary group
   * permissions when enabled.
   *
   * Eventually, this will even generate entity access records for you, but that
   * will only happen after the patch in https://www.drupal.org/node/777578 has
   * been committed to Drupal core.
   *
   * @var bool
   */
  public $entity_access = FALSE;

  /**
   * (optional) The key to use in automatically generated paths.
   *
   * This is exposed through tokens so modules like Pathauto may use it. Only
   * use this if your plugin has something meaningful to show on the actual
   * group content entity; i.e.: the relationship. Otherwise leave blank so it
   * defaults to 'content'.
   *
   * @var string
   */
  public $pretty_path_key = 'content';

  /**
   * (optional) The label for the entity reference field.
   *
   * @var string
   */
  public $reference_label;

  /**
   * (optional) The description for the entity reference field.
   *
   * @var string
   */
  public $reference_description;

  /**
   * (optional) Whether this plugin is always on.
   *
   * @var bool
   */
  public $enforced = FALSE;

  /**
   * (optional) Whether this plugin can only be (un)installed through code.
   *
   * This is useful for plugins that should not be enabled by choice, but rather
   * when certain conditions are met throughout the site. When that happens, you
   * should install the plugin on a group type through code, at which point it
   * will show up in the plugin overview as enabled.
   *
   * @var bool
   */
  public $code_only = FALSE;

  /**
   * (optional) A list of handlers this plugin implements.
   *
   * @var string[]
   */
  public $handlers = [];

  /**
   * (optional) The admin permission for this plugin.
   *
   * @var string|false
   */
  public $admin_permission = FALSE;

}

Members

Namesort descending Modifiers Type Description Overrides
GroupContentEnabler::$admin_permission public property (optional) The admin permission for this plugin.
GroupContentEnabler::$code_only public property (optional) Whether this plugin can only be (un)installed through code.
GroupContentEnabler::$description public property A short description of the GroupContentEnabler plugin.
GroupContentEnabler::$enforced public property (optional) Whether this plugin is always on.
GroupContentEnabler::$entity_access public property (optional) Whether the plugin defines entity access.
GroupContentEnabler::$entity_bundle public property (optional) The bundle of the entity type you want to enable as group content.
GroupContentEnabler::$entity_type_id public property The ID of the entity type you want to enable as group content.
GroupContentEnabler::$handlers public property (optional) A list of handlers this plugin implements.
GroupContentEnabler::$id public property The plugin ID.
GroupContentEnabler::$label public property The human-readable name of the GroupContentEnabler plugin.
GroupContentEnabler::$pretty_path_key public property (optional) The key to use in automatically generated paths.
GroupContentEnabler::$reference_description public property (optional) The description for the entity reference field.
GroupContentEnabler::$reference_label public property (optional) The label for the entity reference field.
Plugin::$definition protected property The plugin definition read from the class annotation. 1
Plugin::get public function Gets the value of an annotation. Overrides AnnotationInterface::get 5
Plugin::getClass public function Gets the class of the annotated class. Overrides AnnotationInterface::getClass
Plugin::getId public function Gets the unique ID for this annotated class. Overrides AnnotationInterface::getId
Plugin::getProvider public function Gets the name of the provider of the annotated class. Overrides AnnotationInterface::getProvider
Plugin::parse protected function Parses an annotation into its definition.
Plugin::setClass public function Sets the class of the annotated class. Overrides AnnotationInterface::setClass
Plugin::setProvider public function Sets the name of the provider of the annotated class. Overrides AnnotationInterface::setProvider
Plugin::__construct public function Constructs a Plugin object. 2