public function findAverageNote(Thread $thread)
    {
        return $this->repository->createQueryBuilder('c')
            ->select('avg(c.note)')
            ->where('c.private <> :private')
            ->andWhere('c.thread = :thread')
            ->setParameters([
                'private' => 1,
                'thread' => $thread,
            ])
            ->getQuery()
            ->getSingleScalarResult();
    }
public function findAverageNote(Thread $thread)
    {
        return $this->repository->createQueryBuilder('c')
            ->select('avg(c.note)')
            ->where('c.private <> :private')
            ->andWhere('c.thread = :thread')
            ->setParameters([
                'private' => 1,
                'thread' => $thread,
            ])
            ->getQuery()
            ->getSingleScalarResult();
    }
public function findAverageNote ( Thread $ thread ) { return $ this -> repository -> createQueryBuilder ( 'c' ) -> select ( 'avg(c.note)' ) -> where ( 'c.private <> :private' ) -> andWhere ( 'c.thread = :thread' ) -> setParameters ( [ 'private' => 1 , 'thread' => $ thread , ] ) -> getQuery ( ) -> getSingleScalarResult ( ) ; }
Returns Thread average note.

@param Thread $thread

@return float
Returns Thread average note .