protected function EntityLabel::getEntityTypeFromValues in Commerce License 8.2
Returns the entity type to use for a given result row.
Parameters
\Drupal\views\ResultRow $row: A result row of values retrieved from the database.
Return value
string The entity type to use for a given result row.
2 calls to EntityLabel::getEntityTypeFromValues()
- EntityLabel::preRender in src/
Plugin/ views/ field/ EntityLabel.php - Runs before any fields are rendered.
- EntityLabel::render in src/
Plugin/ views/ field/ EntityLabel.php - Renders the field.
File
- src/
Plugin/ views/ field/ EntityLabel.php, line 63
Class
- EntityLabel
- Field handler to display entity label optionally linked to entity page.
Namespace
Drupal\commerce_license\Plugin\views\fieldCode
protected function getEntityTypeFromValues(ResultRow $row) {
// Support a dynamically defined entity type.
if (!empty($this->definition['entity type field'])) {
$entity_type_id = $this
->getValue($row, $this->definition['entity type field']);
return $entity_type_id;
}
else {
// Fall back to the entity type of the table.
return parent::getEntityType();
}
}