Added $processCollection to the getForGraph method
This commit is contained in:
parent
9a6e8e3dc1
commit
14a79447f5
|
|
@ -48,7 +48,8 @@ interface StatisticsStore
|
||||||
* format that is easily to read for graphs.
|
* format that is easily to read for graphs.
|
||||||
*
|
*
|
||||||
* @param callable $processQuery
|
* @param callable $processQuery
|
||||||
|
* @param callable $processCollection
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getForGraph(callable $processQuery = null): array;
|
public function getForGraph(callable $processQuery = null, callable $processCollection = null): array;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -86,12 +86,13 @@ class DatabaseStore implements StatisticsStore
|
||||||
* format that is easily to read for graphs.
|
* format that is easily to read for graphs.
|
||||||
*
|
*
|
||||||
* @param callable $processQuery
|
* @param callable $processQuery
|
||||||
|
* @param callable $processCollection
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getForGraph(callable $processQuery = null): array
|
public function getForGraph(callable $processQuery = null, callable $processCollection = null): array
|
||||||
{
|
{
|
||||||
$statistics = collect(
|
$statistics = collect(
|
||||||
$this->getRecords($processQuery)
|
$this->getRecords($processQuery, $processCollection)
|
||||||
);
|
);
|
||||||
|
|
||||||
return $this->statisticsToGraph($statistics);
|
return $this->statisticsToGraph($statistics);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue