public function IcalFieldsWizard::getEntity in Views iCal 8
Gets the entity for a corresponding row.
Parameters
\Drupal\views\ResultRow $row:
Return value
\Drupal\Core\Entity\EntityInterface|null
4 calls to IcalFieldsWizard::getEntity()
- IcalFieldsWizard::addDateRangeEvent in src/
Plugin/ views/ row/ IcalFieldsWizard.php - Create an event based on a daterange field.
- IcalFieldsWizard::addDateRecurEvent in src/
Plugin/ views/ row/ IcalFieldsWizard.php - IcalFieldsWizard::addDateTimeEvent in src/
Plugin/ views/ row/ IcalFieldsWizard.php - Create an event based on a datetime field
- IcalFieldsWizard::addSmartDateEvent in src/
Plugin/ views/ row/ IcalFieldsWizard.php - Create an event based on a smartdate field.
File
- src/
Plugin/ views/ row/ IcalFieldsWizard.php, line 597 - Contains \Drupal\views_ical\Plugin\views\row\Fields.
Class
- IcalFieldsWizard
- The 'Ical Fields' row plugin
Namespace
Drupal\views_ical\Plugin\views\rowCode
public function getEntity($row) {
if ($this->view->storage
->get('base_table') == 'node_field_data') {
// TODO, Change how this is being accessed so it's not using private properties
$entity = $row->_entity;
}
else {
if ($this->view->storage
->get('base_table') == 'search_api_index_default_content_index') {
$entity = $row->_object
->getValue();
}
else {
throw new Exception('Base table type not supported. At the moment, Views iCal only supports nodes and Search API indexes');
}
}
return $entity;
}