PHP Class PartKeepr\StatisticBundle\Services\StatisticService

Exibir arquivo Open project: partkeepr/PartKeepr

Public Methods

Method Description
__construct ( EntityManager $entityManager )
createStatisticSnapshot ( )
getAveragePrice ( ) : float Returns the average price for all parts. Only parts with a price are calculated.
getPartCategoryCount ( ) : integer Returns the part category count.
getPartCount ( boolean | false $withoutPrice = false ) : mixed Returns the part count.
getSampledStatistics ( DateTime $startDate, DateTime $endDate, integer $sampleSize = 25 ) : array Gets the sampled statistics.
getStatisticRange ( ) Returns the range of all recorded statistic snapshots.
getTotalPrice ( ) : float Returns the total price for all parts. Only parts with a price are calculated.
getUnitCounts ( ) : array Returns the part counts per part unit.

Method Details

__construct() public method

public __construct ( EntityManager $entityManager )
$entityManager Doctrine\ORM\EntityManager

createStatisticSnapshot() public 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

getPartCategoryCount() public method

Returns the part category count.
public getPartCategoryCount ( ) : integer
return integer

getPartCount() public method

Returns the part count.
public getPartCount ( boolean | false $withoutPrice = false ) : mixed
$withoutPrice boolean | false Set to true to retrieve all parts where the average price is null
return mixed

getSampledStatistics() public method

Gets the sampled statistics.
public getSampledStatistics ( DateTime $startDate, DateTime $endDate, integer $sampleSize = 25 ) : array
$startDate DateTime
$endDate DateTime
$sampleSize integer
return array

getStatisticRange() public method

Returns the range of all recorded statistic snapshots.
public getStatisticRange ( )

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

getUnitCounts() public method

Returns the part counts per part unit.
public getUnitCounts ( ) : array
return array An array of arrays with the keys "name" and "stockLevel"