Skip to content

Commit

Permalink
ROOMS-122: Add relationship handler for units from commerce line items
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolò Caruso committed May 16, 2018
1 parent ff98d04 commit 89cd821
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@
*/


/**
* Implements hook_views_data_alter().
*/
function rooms_booking_manager_views_data_alter(&$data) {
if (isset($data['field_data_rooms_booked_unit_id']['rooms_booked_unit_id_value'])) {
$data['field_data_rooms_booked_unit_id']['rooms_booked_unit_id_value']['relationship'] = array(
'title' => t('Booked Unit'),
'help' => t("Relate this field to its bookable unit"),
'handler' => 'views_handler_relationship',
'base' => 'rooms_units',
'base field' => 'unit_id',
'field' => 'rooms_booked_unit_id_value',
'label' => t('Booking unit'),
);
}
}

/**
* Implements hook_views_default_views().
*/
Expand Down

0 comments on commit 89cd821

Please sign in to comment.