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

getTotalPrice() public method

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