АК
Size: a a a
АК
АК
АК
АК
АК
L
*/
class HousingViewsData extends EntityViewsData {
/**
* {@inheritdoc}
*/
public function getViewsData() {
$data = parent::getViewsData();
// Additional information for Views integration, such as table joins, can be
// put here.
// subscription__housings
$data['housing']['subscription'] = [
'title' => $this->t('Subscription reverse'),
'help' => $this->t('Subscription to a Housing.'),
'relationship' => [
'field table' => 'subscription__housings',
'field field' => 'housings_target_id',
'field_name' => 'subscription_base',
'id' => 'entity_reverse',
'base' => 'subscription',
'base field' => 'id',
'label' => $this->t('Subscription reverse'),
],
];
L
/*
$data['{MAIN ENTITY BASE TABLE}']['{useful non-conflicting name - I used the {RELATED ENTITY BASE TABLE}}'] = [
'title' => t('{some useful title that displays in Add Relationships popup}'),
'help' => t('{some useful description that displays in Add Relationships popup}'),
'relationship' => [
'field table' => '{name of intermediary table - it is probably {RELATED ENTITY}__{FIELD NAME}',
'field field' => '{name of intermediary field - it is probably {FIELD NAME}_target_id',
'base' => '{RELATED ENTITY BASE TABLE}',
'base field' => '{RELATED ENTITY ID FIELD}',
'id' => 'entity_reverse',
'label' => '{some useful label that displays in Relationship select in various views field settings popups}',
],
];
*/
АК