当前位置: 首页>>代码示例>>PHP>>正文


PHP Store::find方法代码示例

本文整理汇总了PHP中Store::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Store::find方法的具体用法?PHP Store::find怎么用?PHP Store::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Store的用法示例。


在下文中一共展示了Store::find方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getDishes

 /**
  * show all dishes for a specific store
  *
  * @param integer $id
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
  */
 public function getDishes($id)
 {
     if ($store = Store::find($id)) {
         return View::make('store.dishes', ['store' => $store]);
     }
     return Redirect::back();
 }
开发者ID:fashionforhome,项目名称:fressen4home,代码行数:13,代码来源:StoreController.php

示例2: getMenu

 public function getMenu($id)
 {
     $img = Store::find($id);
     $path = $img->menu;
     $mime = $img->mime;
     header("Content-Type: {$mime}");
     readfile($path);
     exit;
 }
开发者ID:rainbowfart,项目名称:foodorder,代码行数:9,代码来源:StoreController.php

示例3: getStores

 function getStores()
 {
     $brand_stores = array();
     $db_stores = $GLOBALS['DB']->query("SELECT stores.* FROM\n                brands JOIN brands_stores ON (brands.id = brands_stores.brand_id)\n                       JOIN stores ON (brands_stores.store_id = stores.id)\n                WHERE brands.id = {$this->getId()};");
     foreach ($db_stores as $store) {
         $found_store = Store::find($store['id']);
         array_push($brand_stores, $found_store);
     }
     return $brand_stores;
 }
开发者ID:ben-pritchard,项目名称:Epicodus-Assessment---PHP-Many-to-Many-in-Silex,代码行数:10,代码来源:Brand.php

示例4: testFind

 function testFind()
 {
     $name = "Clides";
     $test_store = new Store($name);
     $test_store->save();
     $name2 = "Marthas";
     $test_store2 = new Store($name2);
     $test_store2->save();
     $result = Store::find($test_store2->getId());
     $this->assertEquals($test_store2, $result);
 }
开发者ID:alexMcosta,项目名称:Shoes_Brands,代码行数:11,代码来源:StoreTest.php

示例5: detail

 public function detail($id)
 {
     $param['store'] = StoreModel::find($id);
     $param['servedCount'] = QueueModel::where('store_id', $id)->count();
     $userId = Session::has('user_id') ? Session::get('user_id') : 0;
     $queueNo = QueueModel::where('user_id', $userId)->where('store_id', $id)->whereRaw('DATE(created_at) = DATE(NOW())')->orderBy('created_at', 'DESC')->get();
     if (count($queueNo) > 0) {
         $queueNo = $queueNo[0]->queue_no;
     } else {
         $queueNo = null;
     }
     $param['queueNo'] = $queueNo;
     return View::make('user.store.detail')->with($param);
 }
开发者ID:victory21th,项目名称:QM-Laravel,代码行数:14,代码来源:StoreController.php

示例6: apply

 public function apply()
 {
     if (Input::has('store_id')) {
         $storeId = Input::get('store_id');
         $status = StatusModel::where('store_id', $storeId)->first();
         $queueNo = $status->last_queue_no;
         $status->last_queue_no = $queueNo + 1;
         $status->save();
         $store = StoreModel::find($storeId);
         return Response::json(['result' => 'success', 'msg' => '', 'queue_no' => $queueNo + 1, 'created_at' => $status->updated_at->format('Y-m-d H:i:s'), 'logo' => HTTP_PATH . "/assets/img/logo.png"]);
     } else {
         return Response::json(['result' => 'failed', 'msg' => 'Invalid Request']);
     }
 }
开发者ID:victory21th,项目名称:QM-Laravel,代码行数:14,代码来源:TabletController.php

示例7: postCreate

 /**
  * create a delivery
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function postCreate()
 {
     $nowDateTime = $this->getDateTimeAfterNow(5);
     $validator = Validator::make(Input::all(), array('store' => 'required|numeric|exists:stores,id', 'closing_time' => 'date_format:Y-m-d H:i:s|after:' . $nowDateTime->format('Y-m-d H:i:s')));
     if ($validator->passes() === false) {
         return Redirect::back()->withErrors($validator);
     }
     $storeId = Input::get('store');
     $closingTime = Input::get('closing_time');
     $store = Store::find($storeId);
     $delivery = new Delivery();
     $delivery->user()->associate(Auth::user());
     $delivery->store()->associate($store);
     $delivery->closing_time = $closingTime;
     $delivery->save();
     // push notification
     F4H\Pusher::push('delivery.created', array('user' => Auth::user()->email, 'store' => $store->name, 'closing_time' => $closingTime, 'delivery' => $delivery->getKey()));
     return Redirect::route('delivery.active');
 }
开发者ID:fashionforhome,项目名称:fressen4home,代码行数:24,代码来源:DeliveryController.php

示例8: fire

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $file = $this->argument('file');
     $storeId = $this->argument('storeId');
     if (file_exists($file) === false || is_readable($file) === false) {
         $this->error('"' . $file . '" does not exist or is not readable.');
         return;
     }
     if (Store::find($storeId)->getKey() === null) {
         $this->error('A store with ID "' . $storeId . '" does not exist.');
         return;
     }
     $this->info('Importing dishes from "' . $file . '" to store with ID ' . $storeId . '...');
     $header = $this->readLine();
     while (($line = $this->readLine()) !== FALSE) {
         $dish = $this->getNewObject($this->mergeData($header, $line));
         $dish->save();
         $this->comment(' - "' . $dish->name . '" ID: ' . $dish->getKey());
     }
     $this->info('Importing stores completed.');
 }
开发者ID:fashionforhome,项目名称:fressen4home,代码行数:26,代码来源:ImportDishCommand.php

示例9: test_find

 function test_find()
 {
     //Arrange
     $retailer = "Nordstrom";
     $address = "1234 SW Main Street";
     $phone = "123-456-7890";
     $id = null;
     $test_store = new Store($retailer, $address, $phone, $id);
     $test_store->save();
     $retailer2 = "Macys";
     $address2 = "400 SW 6th Avenue";
     $phone2 = "888-888-8888";
     $test_store2 = new Store($retailer2, $address2, $phone2, $id);
     $test_store2->save();
     //Act
     $result = Store::find($test_store2->getId());
     //Assert
     $this->assertEquals($test_store2, $result);
 }
开发者ID:jcubed22,项目名称:Shoes,代码行数:19,代码来源:StoreTest.php

示例10: test_find

 function test_find()
 {
     //Arrange
     $id = null;
     $store_name = "Fred Meyers";
     $test_store = new Store($id, $store_name);
     $test_store->save();
     $id2 = null;
     $store_name2 = "Walmart";
     $test_store2 = new Store($id2, $store_name2);
     $test_store2->save();
     //Act
     $result = Store::find($test_store->getId());
     //Assert
     $this->assertEquals($test_store, $result);
 }
开发者ID:sammartinez,项目名称:shoes,代码行数:16,代码来源:StoreTest.php

示例11: testFind

 function testFind()
 {
     //Arrange
     $name = "shoe store";
     $location = "1234 nw 1st street";
     $id = 4;
     $test_store = new Store($name, $location, $id);
     $test_store->save();
     $name2 = "other store";
     $location2 = "5555 sw 2nd street";
     $id2 = 3;
     $test_store2 = new Store($name2, $location2, $id2);
     $test_store2->save();
     //Act
     $result = Store::find($test_store2->getId());
     //Assert
     $this->assertEquals($test_store2, $result);
 }
开发者ID:bencasalino,项目名称:cr4,代码行数:18,代码来源:StoreTest.php

示例12: test_find

 function test_find()
 {
     //Arrange
     $store_name = "Portland Running Company";
     $id = null;
     $test_store = new Store($store_name, $id);
     $test_store->save();
     $store_name2 = "New Balance";
     $test_store2 = new Store($store_name2, $id);
     $test_store2->save();
     //Act
     $id = $test_store->getId();
     $result = Store::find($id);
     //Assert
     $this->assertEquals($test_store, $result);
 }
开发者ID:kennygrage,项目名称:dish,代码行数:16,代码来源:StoreTest.php

示例13: save_store

 public function save_store()
 {
     $id = Input::get('id');
     $white = Input::file('logo_white');
     $color = Input::file('logo');
     $store = Store::find($id);
     $cities = City::all();
     $zipcodes = array();
     foreach ($cities as $city) {
         array_push($zipcodes, $city->zipcode);
     }
     $flag = 0;
     if (!$store) {
         $store = new Store();
         $flag = 1;
     }
     $store->name = Input::get('name');
     $store->minimum_order_amount = Input::get('minimum_order_amount');
     $validator = Validator::make(array('white' => $white, 'color' => $color), array('white' => 'required|mimes:jpeg,bmp,png', 'color' => 'required|mimes:jpeg,bmp,png'));
     if ($validator->fails()) {
         $error_messages = $validator->messages();
         $response_array = array('success' => false, 'error' => 'Invalid Input', 'error_code' => 401);
         $response_code = 200;
         $message = "Invalid Input File";
         $type = "failed";
         return Redirect::to('/admin/stores')->with('type', $type)->with('message', $message);
     } else {
         if (Input::hasFile('logo')) {
             $store->logo_url = upload_image(Input::file('logo'));
         } else {
             if ($flag == 1) {
                 $store->logo_url = web_url() . "/uploads/default_store_logo.png";
             }
         }
         if (Input::hasFile('logo_white')) {
             $store->logo_white_url = upload_image(Input::file('logo_white'));
         } else {
             if ($flag == 1) {
                 $store->logo_white_url = web_url() . "/uploads/default_white_store_logo.png";
             }
         }
         $store->save();
         StoreLocation::where('store_id', $id)->delete();
         foreach ($zipcodes as $zipcode) {
             $store_location = new StoreLocation();
             $store_location->store_id = $store->id;
             $store_location->zipcode = $zipcode;
             $store_location->save();
         }
         $message = "Successfully updated the store";
         $type = "success";
         return Redirect::to('/admin/stores')->with('type', $type)->with('message', $message);
     }
 }
开发者ID:sohelrana820,项目名称:mario-gomez,代码行数:54,代码来源:AdminController.php

示例14: test_find

 function test_find()
 {
     //Arrange
     $name = "House of Shoes and Waffles";
     $address = "123 Street";
     $phone = "4-44";
     $test_store = new Store($name, $address, $phone);
     $test_store->save();
     $name2 = "Bob's Shoe Palace";
     $address2 = "456 Main Street";
     $phone2 = "1-800-NEW-SHOE";
     $test_store2 = new Store($name, $address, $phone);
     $test_store2->save();
     //Act
     $result = Store::find($test_store2->getId());
     //Assert
     $this->assertEquals($test_store2, $result);
 }
开发者ID:r-hills,项目名称:Shoes,代码行数:18,代码来源:StoreTest.php

示例15: test_find

 function test_find()
 {
     //Arrange
     $store_name = "Flying Shoes";
     $id = 1;
     $test_store = new Store($store_name, $id);
     $test_store->save();
     //Act
     $result = Store::find($test_store->getId());
     //Assert
     $this->assertEquals($test_store, $result);
 }
开发者ID:kevintokheim,项目名称:Shoe_Store,代码行数:12,代码来源:StoreTest.php


注:本文中的Store::find方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。