PartKeepr\StatisticBundle\Services\StatisticService::getAveragePrice PHP Method

getAveragePrice() public method

Returns the average price for all parts. Only parts with a price are calculated.
public getAveragePrice ( ) : float
return float The average price
    public function getAveragePrice()
    {
        $dql = "SELECT AVG(p.averagePrice) FROM PartKeepr\\PartBundle\\Entity\\Part p";
        return $this->entityManager->createQuery($dql)->getSingleScalarResult();
    }