Commit ba61a528 authored by droces's avatar droces

Commented out kint call

parent 2c8a4169
......@@ -54,7 +54,7 @@ function abookings_theme() {
/**
* Runs a query to fetch all bookable units.
*
*
* @return array
* An array in the format: ['nid' => node].
*/
......@@ -82,7 +82,7 @@ function get_bookables() {
/**
* Runs a query to fetch all bookings that have a specific booking status.
*
*
* @param string $status
* The value of the booking status the bookings must have.
*
......@@ -106,10 +106,10 @@ function get_bookings($status) {
/**
* Runs a query to fetch a promotion with a specific promo code. Returns the first matched promotion.
*
*
* @param string $code_provided
* A string of the value of the promo code that the promotions must have.
*
*
* @return \Drupal\node\Entity\Node
* The first promotion node found matching the promo code provided.
*/
......@@ -134,7 +134,7 @@ function get_promo($code_provided, $checkin_date, $nights) {
// Check if code provided matches this promo's code
$code = $promo->get('field_promo_code')->getValue()[0]['value'];
// kint($code, '$code');
// kint($code, '$code');
if ($code_provided !== $code) {
continue;
}
......@@ -148,7 +148,7 @@ function get_promo($code_provided, $checkin_date, $nights) {
// Check that booking is for at least 'min nights'.
$min_nights = $promo->get('field_min_nights')->getValue()[0]['value'];
if (! (intval($nights) >= intval($min_nights))) {
throw new BadRequestHttpException("Matched code, but too few nights.");
}
......@@ -213,7 +213,7 @@ function abookings_node_form_validate($form, FormStateInterface &$form_state) {
function validate_promo($form_state, $promo_code_provided, $checkin_date, $nights) {
$promo;
try {
try {
$promo = get_promo($promo_code_provided, $checkin_date, $nights);
}
catch (BadRequestHttpException $e) {
......@@ -231,7 +231,7 @@ function validate_promo($form_state, $promo_code_provided, $checkin_date, $night
$form_state->setErrorByName('abookings', $message);
return NULL;
}
// submission_apply_promotion($promo, $form_state);
......@@ -268,7 +268,7 @@ function save_promo_line_item($code, $amount, $booking, $date) {
/**
* Applies a promotion's discount to the total cost of a new booking.
*
*
* @param \Drupal\node\Entity\Node $promo
* The promotion node that whose discount should be applied.
* @param FormStateInterface $form_state
......@@ -365,7 +365,7 @@ function abookings_node_form_submit($form, FormStateInterface &$form_state) {
/**
* Implements hook_mail().
*
*
* Provides a 'from' email address, subject, and body for booking emails.
*/
function abookings_mail($key, &$message, $params) {
......@@ -392,11 +392,11 @@ function abookings_mail($key, &$message, $params) {
/**
* Implements hook_cron().
*
*
* Triggers checks on provisional and confirmed bookings.
*/
function abookings_cron() {
kint('abookings_cron()');
// kint('abookings_cron()');
check_provisional_bookings();
check_confirmed_bookings();
}
......@@ -455,7 +455,7 @@ function check_provisional_bookings() {
/**
* Sends emails to notify guest and owner about expired booking, then sets the booking status to expired.
*
*
* @param \Drupal\node\Entity\Node $booking
* The booking that has expired
* @param \Drupal\node\Entity\Node $bookable
......@@ -550,9 +550,9 @@ function check_confirmed_bookings() {
/**
* Performs cleanup for a booking that has just been completed.
*
*
* Sends emails to get feedback from guest and to notify owner about completed booking, then sets the booking status to completed.
*
*
* @param \Drupal\node\Entity\Node $booking
* The booking that has completed
* @param \Drupal\node\Entity\Node $bookable
......@@ -685,4 +685,4 @@ function get_bookings_data() {
}
// kint($content['#attached']['drupalSettings']['seasons'], 'seasons_data settings');
return $bookings_renderable;
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment