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
- class \Drupal\Component\Annotation\Plugin implements AnnotationInterface
- class \Drupal\group\Annotation\GroupContentEnabler
Expanded class hierarchy of GroupContentEnabler
See also
\Drupal\group\Plugin\GroupContentEnablerInterface
\Drupal\group\Plugin\GroupContentEnablerManager
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.
File
- src/
Annotation/ GroupContentEnabler.php, line 21
Namespace
Drupal\group\AnnotationView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
GroupContentEnabler:: |
public | property | (optional) The admin permission for this plugin. | |
GroupContentEnabler:: |
public | property | (optional) Whether this plugin can only be (un)installed through code. | |
GroupContentEnabler:: |
public | property | A short description of the GroupContentEnabler plugin. | |
GroupContentEnabler:: |
public | property | (optional) Whether this plugin is always on. | |
GroupContentEnabler:: |
public | property | (optional) Whether the plugin defines entity access. | |
GroupContentEnabler:: |
public | property | (optional) The bundle of the entity type you want to enable as group content. | |
GroupContentEnabler:: |
public | property | The ID of the entity type you want to enable as group content. | |
GroupContentEnabler:: |
public | property | (optional) A list of handlers this plugin implements. | |
GroupContentEnabler:: |
public | property | The plugin ID. | |
GroupContentEnabler:: |
public | property | The human-readable name of the GroupContentEnabler plugin. | |
GroupContentEnabler:: |
public | property | (optional) The key to use in automatically generated paths. | |
GroupContentEnabler:: |
public | property | (optional) The description for the entity reference field. | |
GroupContentEnabler:: |
public | property | (optional) The label for the entity reference field. | |
Plugin:: |
protected | property | The plugin definition read from the class annotation. | 1 |
Plugin:: |
public | function |
Gets the value of an annotation. Overrides AnnotationInterface:: |
5 |
Plugin:: |
public | function |
Gets the class of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function |
Gets the unique ID for this annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function |
Gets the name of the provider of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
protected | function | Parses an annotation into its definition. | |
Plugin:: |
public | function |
Sets the class of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function |
Sets the name of the provider of the annotated class. Overrides AnnotationInterface:: |
|
Plugin:: |
public | function | Constructs a Plugin object. | 2 |