abstract class ContentTypeBase in Opigno group manager 3.x
Same name and namespace in other branches
- 8 src/ContentTypeBase.php \Drupal\opigno_group_manager\ContentTypeBase
Class ContentTypeBase.
@package Drupal\opigno_group_manager
This class contains the basics that every plugin implementation of Learning Path Content Type should extend from.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\opigno_group_manager\ContentTypeBase implements ContentTypeInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of ContentTypeBase
File
- src/
ContentTypeBase.php, line 15
Namespace
Drupal\opigno_group_managerView source
abstract class ContentTypeBase extends PluginBase implements ContentTypeInterface {
/**
* Returns entity type.
*
* @return string
* Entity type.
*/
public function getEntityType() {
return $this->pluginDefinition['entity_type'];
}
/**
* Returns ID.
*
* @return string
* ID.
*/
public function getId() {
return $this->pluginDefinition['id'];
}
/**
* Returns readable name.
*
* @return string
* Readable name.
*/
public function getReadableName() {
return $this->pluginDefinition['readable_name'];
}
/**
* Returns description.
*
* @return string
* Description.
*/
public function getDescription() {
return $this->pluginDefinition['description'];
}
/**
* Returns allowed group types.
*
* @return string
* Allowed group types.
*/
public function getAllowedGroupTypes() {
return $this->pluginDefinition['allowed_group_types'];
}
/**
* Returns plugin id.
*
* @return string
* Plugin id.
*/
public function getGroupContentPluginId() {
return $this->pluginDefinition['group_content_plugin_id'];
}
/**
* Get the URL object for starting the quiz.
*
* @param int $content_id
* The content ID (ex: node ID).
* @param int $group_id
* The group ID (optional).
*
* @return \Drupal\Core\Url
* The URL to use to start the "test" for a student.
*/
public function getStartContentUrl($content_id, $group_id = NULL) {
return $this
->getViewContentUrl($content_id);
}
/**
* Answer if the current page should show the "finish" button.
*
* By default, it returns the value from shouldShowNext().
*
* @return bool
* TRUE if the page should show the "finish" button. FALSE otherwise.
*/
public function shouldShowFinish() {
return $this
->shouldShowNext();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ContentTypeBase:: |
public | function | Returns allowed group types. | |
ContentTypeBase:: |
public | function | Returns description. | |
ContentTypeBase:: |
public | function | Returns entity type. | |
ContentTypeBase:: |
public | function | Returns plugin id. | |
ContentTypeBase:: |
public | function | Returns ID. | |
ContentTypeBase:: |
public | function | Returns readable name. | |
ContentTypeBase:: |
public | function | Get the URL object for starting the quiz. | |
ContentTypeBase:: |
public | function | Answer if the current page should show the "finish" button. | |
ContentTypeInterface:: |
public | function | Get all the entities in an array of LearningPathContent. | |
ContentTypeInterface:: |
public | function | Get all the published entities in an array of LearningPathContent. | |
ContentTypeInterface:: |
public | function | Get the entity as a LearningPathContent. | |
ContentTypeInterface:: |
public | function | Try to get the content from a Request object. | |
ContentTypeInterface:: |
public | function | Get the form object based on the entity ID. | |
ContentTypeInterface:: |
public | function | Get the score of the user for a specific entity. | |
ContentTypeInterface:: |
public | function | Get the URL object of the main view page of a specific entity. | |
ContentTypeInterface:: |
public | function | Return TRUE if the page should show the "next" action button. | |
DependencySerializationTrait:: |
protected | property | ||
DependencySerializationTrait:: |
protected | property | ||
DependencySerializationTrait:: |
public | function | 2 | |
DependencySerializationTrait:: |
public | function | 2 | |
MessengerTrait:: |
protected | property | The messenger. | 27 |
MessengerTrait:: |
public | function | Gets the messenger. | 27 |
MessengerTrait:: |
public | function | Sets the messenger. | |
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
2 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
PluginBase:: |
public | function | Constructs a \Drupal\Component\Plugin\PluginBase object. | 98 |
StringTranslationTrait:: |
protected | property | The string translation service. | 4 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |