public function getRankingForUpdate(Chart $chart)
    {
        $queryBuilder = $this->createQueryBuilder('pc');
        $queryBuilder
            ->innerJoin('pc.player', 'p')
            ->addSelect('p')
            ->innerJoin('pc.status', 'status')
            ->addSelect('status')
            ->where('pc.chart = :chart')
            ->setParameter('chart', $chart)
            ->andWhere('status.boolRanking = 1');

        foreach ($chart->getLibs() as $lib) {
            $key             = 'value_' . $lib->getIdLibChart();
            $alias           = 'pcl_' . $lib->getIdLibChart();
            $subQueryBuilder = $this->getEntityManager()->createQueryBuilder()
                ->select(sprintf('%s.value', $alias))
                ->from('VideoGamesRecordsCoreBundle:PlayerChartLib', $alias)
                ->where(sprintf('%s.libChart = :%s', $alias, $key))
                ->andWhere(sprintf('%s.player = pc.player', $alias))
                ->setParameter($key, $lib);

            $queryBuilder
                ->addSelect(sprintf('(%s) as %s', $subQueryBuilder->getQuery()->getDQL(), $key))
                ->addOrderBy($key, $lib->getType()->getOrderBy())
                ->setParameter($key, $lib);
        }
        return $queryBuilder->getQuery()->getResult();
    }
public function getRankingForUpdate(Chart $chart)
    {
        $queryBuilder = $this->createQueryBuilder('pc');
        $queryBuilder
            ->innerJoin('pc.player', 'p')
            ->addSelect('p')
            ->innerJoin('pc.status', 'status')
            ->addSelect('status')
            ->where('pc.chart = :chart')
            ->setParameter('chart', $chart)
            ->andWhere('status.boolRanking = 1');

        foreach ($chart->getLibs() as $lib) {
            $key             = 'value_' . $lib->getIdLibChart();
            $alias           = 'pcl_' . $lib->getIdLibChart();
            $subQueryBuilder = $this->getEntityManager()->createQueryBuilder()
                ->select(sprintf('%s.value', $alias))
                ->from('VideoGamesRecordsCoreBundle:PlayerChartLib', $alias)
                ->where(sprintf('%s.libChart = :%s', $alias, $key))
                ->andWhere(sprintf('%s.player = pc.player', $alias))
                ->setParameter($key, $lib);

            $queryBuilder
                ->addSelect(sprintf('(%s) as %s', $subQueryBuilder->getQuery()->getDQL(), $key))
                ->addOrderBy($key, $lib->getType()->getOrderBy())
                ->setParameter($key, $lib);
        }
        return $queryBuilder->getQuery()->getResult();
    }
public function getRankingForUpdate ( Chart $ chart ) { $ queryBuilder = $ this -> createQueryBuilder ( 'pc' ) ; $ queryBuilder -> innerJoin ( 'pc.player' , 'p' ) -> addSelect ( 'p' ) -> innerJoin ( 'pc.status' , 'status' ) -> addSelect ( 'status' ) -> where ( 'pc.chart = :chart' ) -> setParameter ( 'chart' , $ chart ) -> andWhere ( 'status.boolRanking = 1' ) ; foreach ( $ chart -> getLibs ( ) as $ lib ) { $ key = 'value_' . $ lib -> getIdLibChart ( ) ; $ alias = 'pcl_' . $ lib -> getIdLibChart ( ) ; $ subQueryBuilder = $ this -> getEntityManager ( ) -> createQueryBuilder ( ) -> select ( sprintf ( '%s.value' , $ alias ) ) -> from ( 'VideoGamesRecordsCoreBundle:PlayerChartLib' , $ alias ) -> where ( sprintf ( '%s.libChart = :%s' , $ alias , $ key ) ) -> andWhere ( sprintf ( '%s.player = pc.player' , $ alias ) ) -> setParameter ( $ key , $ lib ) ; $ queryBuilder -> addSelect ( sprintf ( '(%s) as %s' , $ subQueryBuilder -> getQuery ( ) -> getDQL ( ) , $ key ) ) -> addOrderBy ( $ key , $ lib -> getType ( ) -> getOrderBy ( ) ) -> setParameter ( $ key , $ lib ) ; } return $ queryBuilder -> getQuery ( ) -> getResult ( ) ; }
Provides every playerChart for update purpose.

@param \VideoGamesRecords\CoreBundle\Entity\Chart $chart

@return array
Provides every playerChart for update purpose .