public function getByApplicationForEnvironment(Application $application, Environment $environment, $limit = 25, $page = 0, $filter = '')
    {
        $template = ($filter) ? self::DQL_BY_APPLICATION_AND_ENV_WITH_REF_FILTER : self::DQL_BY_APPLICATION_AND_ENV;
        $dql = sprintf($template, Build::class);

        $params = [
            'application' => $application,
            'environment' => $environment,
        ];

        if ($filter) {
            $params['ref'] = $filter;
        }

        return $this->getPaginator($dql, $limit, $page, $params);
    }