You are here

protected function DeploymentStorageHandler::getLabelForNextDeploymentForEnvironment in Build Hooks 3.x

Same name and namespace in other branches
  1. 8.2 src/DeploymentStorageHandler.php \Drupal\build_hooks\DeploymentStorageHandler::getLabelForNextDeploymentForEnvironment()

Gets the label for the next deployment.

Parameters

\Drupal\build_hooks\Entity\FrontendEnvironmentInterface $environment: Environment.

Return value

string Label.

1 call to DeploymentStorageHandler::getLabelForNextDeploymentForEnvironment()
DeploymentStorageHandler::getOrCreateNextDeploymentForEnvironment in src/DeploymentStorageHandler.php
Gets the next deployment for an environment.

File

src/DeploymentStorageHandler.php, line 82

Class

DeploymentStorageHandler
Defines a storage handler for Deployment entities.

Namespace

Drupal\build_hooks

Code

protected function getLabelForNextDeploymentForEnvironment(FrontendEnvironmentInterface $environment) : string {
  if ($last = $this
    ->getLastDeploymentForEnvironment($environment)) {
    return sprintf('Items changed since %s for %s', $this->dateFormatter
      ->format($last->deployed->value), $environment
      ->label());
  }
  return sprintf('First deployment for %s', $environment
    ->label());
}