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;
    }
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;
    }
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 ; }
Get all buildable environments for an application.

@param Application $application

@return Environment[]
Get all buildable environments for an application .