public function getBuildableEnvironmentsByApplication(Application $application)
    {
        $region = sprintf(self::ENV_QUERY_REGION, $application->id());

        $dql = sprintf(self::DQL_BY_APPLICATION, Target::class, Environment::class);

        $query = $this->getEntityManager()
            ->createQuery($dql)
            ->setCacheable(true)
            ->setCacheRegion($region)
            ->setParameter('application', $application);

        $environments = $query->getResult();

        usort($environments, $this->environmentSorter());

        return $environments;
    }