public function DeployLogger::getLastDeployTimeForEnvironment in Build Hooks 8.2
Same name and namespace in other branches
- 3.x src/DeployLogger.php \Drupal\build_hooks\DeployLogger::getLastDeployTimeForEnvironment()
Get the last deployed time for an environment.
Parameters
\Drupal\build_hooks\Entity\FrontendEnvironment $environment: The frontend environment config entity.
Return value
int The timestamp of the latest deployment for the environment.
File
- src/
DeployLogger.php, line 153
Class
- DeployLogger
- Class DeployLogger.
Namespace
Drupal\build_hooksCode
public function getLastDeployTimeForEnvironment(FrontendEnvironment $environment) {
/** @var \Drupal\build_hooks\DeploymentStorageHandlerInterface $deployment_storage */
$deployment_storage = $this->entityTypeManager
->getStorage('build_hooks_deployment');
if ($last = $deployment_storage
->getLastDeploymentForEnvironment($environment)) {
return $last->deployed->value;
}
return 0;
}