Example #1
0
 public function getStoreDrinks($store_id)
 {
     $storeCategories = StoreCategories::getStoreCategories($store_id);
     $storeColdHeats = StoreColdHeats::getStoreColdHeats($store_id);
     if ($storeColdHeats !== false && $storeCategories !== false) {
         return $this->drinksByColdHeat($storeColdHeats, $storeCategories);
     } else {
         $drinks = Drinks::getDrinks($store_id);
         return $drinks;
     }
 }
Example #2
0
 public function getDrink($drink_id, $drink_coldheat_id)
 {
     $drink = Drinks::getById($drink_id);
     if ($drink !== false) {
         $store_id = $drink->store_id;
         $drink->coldheat_levels = $this->getDrinkColdheatLevels($drink_id, $drink_coldheat_id);
         $drink->sugars = $this->getDrinkSugars($drink_id, $drink_coldheat_id);
         $drink->sizes = $this->getDrinkSizes($drink_id, $drink_coldheat_id);
         $drink->extras = $this->getDrinkExtras($drink_id, $drink_coldheat_id);
         $drink->store_coldheat_id = $this->getDrinkColdheat($drink_id, $drink_coldheat_id);
         return (array) $drink;
     } else {
         return false;
     }
 }
Example #3
0
 private function addDrink($drink_name, $store_id)
 {
     $drinks = new Drinks();
     $drink_id = UUID::v4();
     $data = array('id' => $drink_id, 'name' => $drink_name, 'store_id' => $store_id);
     if (false !== $drinks->addDrink($data)) {
         return $drink_id;
     } else {
         return false;
     }
 }