You are here

private function ReservationConflicts::merci_bucket_intersects in MERCI (Manage Equipment Reservations, Checkout and Inventory) 8.2

1 call to ReservationConflicts::merci_bucket_intersects()
ReservationConflicts::bestFit in src/ReservationConflicts.php

File

src/ReservationConflicts.php, line 541
Contains \Drupal\merci\ReservationConflicts. Abstraction of the selection logic of an entity reference field.

Class

ReservationConflicts
A null implementation of EntityReference_SelectionHandler.

Namespace

Drupal\merci

Code

private function merci_bucket_intersects($r1, $r2) {
  $value = $this->date_column;
  $end_value = $this->date_column2;

  /*
   * Make sure r1 start date is before r2 start date.
   */
  if (date_create($r1->{$value}) > date_create($r2->{$value})) {
    $temp = $r1;
    $r1 = $r2;
    $r2 = $temp;
  }
  if (date_create($r2->{$value}) <= date_create($r1->{$end_value})) {
    return true;
  }
  return false;
}