You are here

public function ReservationConflicts::setDateField in MERCI (Manage Equipment Reservations, Checkout and Inventory) 8.2

Overrides ReservationConflictsInterface::setDateField

File

src/ReservationConflicts.php, line 43
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

public function setDateField($date_field) {
  $this->date_field = $date_field;
  $date_storage = $this->entity
    ->get($this->date_field)
    ->getFieldDefinition()
    ->getFieldStorageDefinition();
  $date_columns = $date_storage
    ->getColumns();
  $this->date_column = $this->date_field . '_' . key($date_columns);
  next($date_columns);
  $this->date_column2 = $this->date_field . '_' . key($date_columns);
}