public function ContentTypeILT::getContent in Opigno Instructor-led Trainings 8
Same name and namespace in other branches
- 3.x src/Plugin/OpignoGroupManagerContentType/ContentTypeILT.php \Drupal\opigno_ilt\Plugin\OpignoGroupManagerContentType\ContentTypeILT::getContent()
Parameters
int|\Drupal\opigno_ilt\ILTInterface $entity: The entity ID or entity instance.
Overrides ContentTypeInterface::getContent
2 calls to ContentTypeILT::getContent()
- ContentTypeILT::getAllContents in src/
Plugin/ OpignoGroupManagerContentType/ ContentTypeILT.php - Get all the entities in an array of LearningPathContent.
- ContentTypeILT::getContentFromRequest in src/
Plugin/ OpignoGroupManagerContentType/ ContentTypeILT.php - Try to get the content from a Request object.
File
- src/
Plugin/ OpignoGroupManagerContentType/ ContentTypeILT.php, line 82
Class
- ContentTypeILT
- Class ContentTypeILT.
Namespace
Drupal\opigno_ilt\Plugin\OpignoGroupManagerContentTypeCode
public function getContent($entity) {
// If the value is the ILT ID, load the ILT.
if (is_numeric($entity) || is_string($entity)) {
/** @var \Drupal\opigno_ilt\ILTInterface $entity */
$entity = ILT::load($entity);
}
if ($entity === NULL || $entity === FALSE) {
return FALSE;
}
return new OpignoGroupContent($this
->getPluginId(), $this
->getEntityType(), $entity
->id(), $entity
->label(), $this
->getDefaultModuleImageUrl(), t('Default image'));
}