Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3424701
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3424701
Commits
5c30729a
Verified
Commit
5c30729a
authored
1 year ago
by
Théodore Biadala
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3422845
by scott_euser, smustgrave: Improve the relationships documentation in views.api.php
parent
29f289f3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/modules/views/views.api.php
+7
-3
7 additions, 3 deletions
core/modules/views/views.api.php
with
7 additions
and
3 deletions
core/modules/views/views.api.php
+
7
−
3
View file @
5c30729a
...
...
@@ -313,6 +313,8 @@ function hook_views_data() {
'id'
=>
'standard'
,
// Default label for relationship in the UI.
'label'
=>
t
(
'Example node'
),
// Description shown within the add relationship handler in the UI.
'help'
=>
t
(
'Relationship between the node and node field data'
),
],
];
...
...
@@ -495,8 +497,8 @@ function hook_views_data_alter(array &$data) {
// In Views data definitions, each field can have only one relationship. So
// rather than adding this relationship directly to the $data['foo']['fid']
// field entry, which could overwrite an existing relationship, we define
// a
dummy
field key to handle the relationship.
$data
[
'foo'
][
'unique_
dummy
_name'
]
=
[
// a
placeholder
field key to handle the relationship.
$data
[
'foo'
][
'unique_
placeholder
_name'
]
=
[
'title'
=>
t
(
'Title seen while adding relationship'
),
'help'
=>
t
(
'More information about the relationship'
),
...
...
@@ -506,11 +508,13 @@ function hook_views_data_alter(array &$data) {
// Database field name in example_table for the join.
'base field'
=>
'eid'
,
// Real database field name in foo for the join, to override
// 'unique_
dummy
_name'.
// 'unique_
placeholder
_name'.
'field'
=>
'fid'
,
// ID of relationship handler plugin to use.
'id'
=>
'standard'
,
'label'
=>
t
(
'Default label for relationship'
),
// Description shown within the add relationship handler in the UI.
'help'
=>
t
(
'Description of the placeholder field relationship'
),
],
];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment