Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 10 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| BillingController | |
0.00% |
0 / 10 |
|
0.00% |
0 / 3 |
20 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getAllStoresArray | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| getAllStoresBillingArray | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace BuyerKiosk\Billing\Controllers; |
| 4 | |
| 5 | |
| 6 | use BuyerKiosk\Billing\Bill; |
| 7 | class BillingController { |
| 8 | private $log; |
| 9 | private $storesArray; |
| 10 | private $globalDB; |
| 11 | |
| 12 | public function __construct() |
| 13 | { |
| 14 | $this->globalDB = dbConnectByName($_ENV['DB_NAME']); |
| 15 | $this->getAllStoresArray(); |
| 16 | } |
| 17 | private function getAllStoresArray() { |
| 18 | $stmt = $this->globalDB->prepare("SELECT typeNum FROM stores WHERE active = 1"); |
| 19 | $stmt->execute(); |
| 20 | $this->storesArray = $stmt->fetchAll(\PDO::FETCH_ASSOC); |
| 21 | } |
| 22 | |
| 23 | public function getAllStoresBillingArray($date) { |
| 24 | $billingArray = array(); |
| 25 | foreach($this->storesArray as $store) { |
| 26 | $storeBilling = new Bill($store['typeNum']); |
| 27 | $billingArray[$store['typeNum']] = $storeBilling->getBillingArray($date); |
| 28 | } |
| 29 | return $billingArray; |
| 30 | } |
| 31 | } |