Added $processCollection to the getForGraph method

This commit is contained in:
Alex Renoki 2020-09-18 12:44:07 +03:00
parent 9a6e8e3dc1
commit 14a79447f5
2 changed files with 5 additions and 3 deletions

View File

@ -48,7 +48,8 @@ interface StatisticsStore
* format that is easily to read for graphs.
*
* @param callable $processQuery
* @param callable $processCollection
* @return array
*/
public function getForGraph(callable $processQuery = null): array;
public function getForGraph(callable $processQuery = null, callable $processCollection = null): array;
}

View File

@ -86,12 +86,13 @@ class DatabaseStore implements StatisticsStore
* format that is easily to read for graphs.
*
* @param callable $processQuery
* @param callable $processCollection
* @return array
*/
public function getForGraph(callable $processQuery = null): array
public function getForGraph(callable $processQuery = null, callable $processCollection = null): array
{
$statistics = collect(
$this->getRecords($processQuery)
$this->getRecords($processQuery, $processCollection)
);
return $this->statisticsToGraph($statistics);