merci-8.x-2.x-dev/src/Plugin/Validation/Constraint/MerciAllowOvernightConstraint.php

src/Plugin/Validation/Constraint/MerciAllowOvernightConstraint.php
<?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');
  }
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc