Beispiel #1
0
 public static function getByID($oiID)
 {
     $db = Database::get();
     $data = $db->GetRow("SELECT * FROM VividStoreOrderItems WHERE oiID=?", $oiID);
     if (!empty($data)) {
         $item = new OrderItem();
         $item->setPropertiesFromArray($data);
     }
     return $item instanceof OrderItem ? $item : false;
 }
Beispiel #2
0
 public function remove()
 {
     StoreOrderItem::removeOrderItemsByOrder($this);
     $this->delete();
 }
Beispiel #3
0
 public function getOrderItems()
 {
     $db = Database::get();
     $rows = $db->GetAll("SELECT * FROM VividStoreOrderItems WHERE oID=?", $this->oID);
     $items = array();
     foreach ($rows as $row) {
         $items[] = StoreOrderItem::getByID($row['oiID']);
     }
     return $items;
 }
Beispiel #4
0
 public function getOrderItems()
 {
     $orders = $this->getResults();
     $orderItems = array();
     $db = Database::get();
     foreach ($orders as $order) {
         $oID = $order->getOrderID();
         $OrderOrderItems = $db->GetAll("SELECT * FROM VividStoreOrderItems WHERE oID=?", $oID);
         foreach ($OrderOrderItems as $oi) {
             $oi = StoreOrderItem::getByID($oi['oiID']);
             $orderItems[] = $oi;
         }
     }
     return $orderItems;
 }