Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 16 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| Base | |
0.00% |
0 / 16 |
|
0.00% |
0 / 2 |
20 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
6 | |||
| getDRSFieldsArray | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace BuyerKiosk\QuickBooks; |
| 4 | |
| 5 | class Base { |
| 6 | |
| 7 | protected $db; |
| 8 | protected $store; |
| 9 | protected $storeDB; |
| 10 | protected $log; |
| 11 | |
| 12 | public function __construct(\Store $store = null) |
| 13 | { |
| 14 | global $db_name; |
| 15 | $this->store = $store; |
| 16 | $this->db = dbConnectByName($db_name); |
| 17 | $this->db->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); |
| 18 | $this->db->setAttribute(\PDO::ATTR_EMULATE_PREPARES, false); |
| 19 | |
| 20 | if(!$store == null) { |
| 21 | $this->storeDB = dbConnectByName($this->store->getDbName()); |
| 22 | $this->storeDB->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); |
| 23 | $this->storeDB->setAttribute(\PDO::ATTR_EMULATE_PREPARES, false); |
| 24 | } |
| 25 | |
| 26 | $this->log = new \KLogger($_ENV['LOG_DIR']."quickbooks.log", \KLogger::DEBUG); |
| 27 | } |
| 28 | |
| 29 | public function getDRSFieldsArray() { |
| 30 | if($this->store == null) { |
| 31 | return false; |
| 32 | } |
| 33 | $query = $this->storeDB->prepare("SELECT * FROM drsFields WHERE 1 ORDER BY sfileField ASC"); |
| 34 | $query->execute(); |
| 35 | $drsFieldsArray = $query->fetchAll(\PDO::FETCH_ASSOC); |
| 36 | return $drsFieldsArray; |
| 37 | } |
| 38 | } |