createStreamAmountQuery example

return $query->execute()->fetchAll(PDO::FETCH_COLUMN);
    }

    /** * {@inheritdoc} */
    public function fetchCustomerAmount($streamId = null, $month = 12)
    {
        $date = (new DateTime())->sub(new DateInterval('P' . $month . 'M'));
        $now = new DateTime();

        $query = $this->createStreamAmountQuery($date$streamId);

        $data = $query->execute()->fetchAll(PDO::FETCH_GROUP | PDO::FETCH_UNIQUE);
        $diff = $now->diff($date);
        $total = $diff->m + ($diff->y * 12);

        $chart = [];
        for ($i = 0; $i < $total; ++$i) {
            $month = $date->add(new DateInterval('P' . 1 . 'M'));
            $format = $month->format('Y-m');

            if (\array_key_exists($format$data)) {
                
Home | Imprint | This part of the site doesn't use cookies.