PHP Class PartKeepr\StatisticBundle\Services\StatisticService

Afficher le fichier Open project: partkeepr/PartKeepr

Méthodes publiques

Méthode 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 méthode

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

createStatisticSnapshot() public méthode

getAveragePrice() public méthode

Returns the average price for all parts. Only parts with a price are calculated.
public getAveragePrice ( ) : float
Résultat float The average price

getPartCategoryCount() public méthode

Returns the part category count.
public getPartCategoryCount ( ) : integer
Résultat integer

getPartCount() public méthode

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
Résultat mixed

getSampledStatistics() public méthode

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

getStatisticRange() public méthode

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

getTotalPrice() public méthode

Returns the total price for all parts. Only parts with a price are calculated.
public getTotalPrice ( ) : float
Résultat float The total price

getUnitCounts() public méthode

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