source/Internal/Review/Dao/RatingDao.php
public function getRatingsByProductId($productId)
    {
        $queryBuilder = $this->queryBuilderFactory->create();
        $queryBuilder
            ->select('r.*')
            ->from('oxratings', 'r')
            ->where('r.oxobjectid = :productId')
            ->andWhere('r.oxtype = :productType')
            ->orderBy('r.oxtimestamp', 'DESC')
            ->setParameters(
                [
                    'productId'     => $productId,
                    'productType'   => 'oxarticle',
                ]
            );

        return $this->mapRatings($queryBuilder->execute()->fetchAll());
    }
public function getRatingsByProductId($productId)
    {
        $queryBuilder = $this->queryBuilderFactory->create();
        $queryBuilder
            ->select('r.*')
            ->from('oxratings', 'r')
            ->where('r.oxobjectid = :productId')
            ->andWhere('r.oxtype = :productType')
            ->orderBy('r.oxtimestamp', 'DESC')
            ->setParameters(
                [
                    'productId'     => $productId,
                    'productType'   => 'oxarticle',
                ]
            );

        return $this->mapRatings($queryBuilder->execute()->fetchAll());
    }
public function getRatingsByProductId ( $ productId ) { $ queryBuilder = $ this -> queryBuilderFactory -> create ( ) ; $ queryBuilder -> select ( 'r.*' ) -> from ( 'oxratings' , 'r' ) -> where ( 'r.oxobjectid = :productId' ) -> andWhere ( 'r.oxtype = :productType' ) -> orderBy ( 'r.oxtimestamp' , 'DESC' ) -> setParameters ( [ 'productId' => $ productId , 'productType' => 'oxarticle' , ] ) ; return $ this -> mapRatings ( $ queryBuilder -> execute ( ) -> fetchAll ( ) ) ; }
Returns Ratings for a product.

@param string $productId

@return ArrayCollection
Returns Ratings for a product .