You are here

BuildHooksDeployment.php in Build Hooks 8.2

Same filename and directory in other branches
  1. 3.x src/Plugin/Validation/Constraint/BuildHooksDeployment.php

File

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

namespace Drupal\build_hooks\Plugin\Validation\Constraint;

use Drupal\Core\Entity\Plugin\Validation\Constraint\CompositeConstraintBase;

/**
 * Defines a constraint plugin to ensure there's only one active deployment.
 *
 * @Constraint(
 *   id = "BuildHooksEnvironment",
 *   label = @Translation("One active deployment.", context = "Validation"),
 * )
 */
class BuildHooksDeployment extends CompositeConstraintBase {

  /**
   * The default violation message.
   *
   * @var string
   */
  public $message = 'There is already an active deployment for this environment - see <a href=":url">@label</a>>';

  /**
   * {@inheritdoc}
   */
  public function coversFields() {
    return [
      'environment',
      'status',
    ];
  }

}

Classes

Namesort descending Description
BuildHooksDeployment Defines a constraint plugin to ensure there's only one active deployment.