Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 13 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| StoreFeed | |
0.00% |
0 / 13 |
|
0.00% |
0 / 2 |
30 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getFeedItemArray | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
20 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace BuyerKiosk\ResalePerks; |
| 4 | |
| 5 | class StoreFeed extends Base { |
| 6 | |
| 7 | private $storeDB; |
| 8 | private $store; |
| 9 | |
| 10 | public function __construct(\Store $store) |
| 11 | { |
| 12 | parent::__construct(); |
| 13 | //$this->storeDB = dbConnectByName($store->getDbName()); |
| 14 | $this->store = $store; |
| 15 | } |
| 16 | |
| 17 | public function getFeedItemArray($oldID) { |
| 18 | $tempArray = []; |
| 19 | try { |
| 20 | $stmt = $this->db->prepare("SELECT * FROM rpPosts WHERE typeNum = :typeNum AND id > :oldID ORDER BY dateAdded DESC LIMIT 15"); |
| 21 | $stmt->bindValue(":typeNum", $this->store->getTypeNum()); |
| 22 | $stmt->bindValue(":oldID", $oldID); |
| 23 | if($stmt->execute()) { |
| 24 | while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { |
| 25 | $tempFeedItem = new FeedItem(); |
| 26 | $tempArray[] = $tempFeedItem->postRowToFeedItem($row); |
| 27 | } |
| 28 | return $tempArray; |
| 29 | } |
| 30 | } catch (\PDOException $e) { |
| 31 | $this->log->LogError($e->getMessage()); |
| 32 | } |
| 33 | } |
| 34 | } |