October 2017
Intermediate to advanced
566 pages
14h 31m
English
The fact that the data about the teams our players belong to is stored in a different table means that at a database level a join will have to be created to pull them together. In Views lingo this is a relationship in the sense that one table relates to another and the way these are declared is directional from a field to another from the joined table. So, let's see how we can define the team_id field from the players table to join with the teams table on its id field:
$data['players']['team_id'] = array( 'title' => t('Team ID'), 'help' => t('The unique team ID of the player.'), 'field' => array( 'id' => 'numeric', ), 'relationship' => array( 'base' => 'teams', 'base field' => 'id', 'id' => 'standard', 'label' => t('Player ...Read now
Unlock full access