You are here

MerciAllowOvernightConstraint.php in MERCI (Manage Equipment Reservations, Checkout and Inventory) 8.2

File

src/Plugin/Validation/Constraint/MerciAllowOvernightConstraint.php
View source
<?php

/**
 * @file
 * Contains \Drupal\merci\Plugin\Validation\Constraint\MerciAllowOvernightConstraint.
 */
namespace Drupal\merci\Plugin\Validation\Constraint;

use Symfony\Component\Validator\Constraint;

/**
 * Checks that the node is assigned only a "leaf" term in the forum taxonomy.
 *
 * @Constraint(
 *   id = "MerciAllowOvernight",
 *   label = @Translation("MerciAllowOvernight", context = "Validation"),
 * )
 */
class MerciAllowOvernightConstraint extends Constraint {
  public $date_field;
  public $overnight_field;
  public $grouping_field;
  public $message = 'Reservation can not go overnight.';

  /**
   ** {@inheritdoc}
   */
  public function getRequiredOptions() {
    return array(
      'date_field',
      'overnight_field',
    );
  }

}

Classes

Namesort descending Description
MerciAllowOvernightConstraint Checks that the node is assigned only a "leaf" term in the forum taxonomy.