當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Store::getAll方法代碼示例

本文整理匯總了PHP中Store::getAll方法的典型用法代碼示例。如果您正苦於以下問題:PHP Store::getAll方法的具體用法?PHP Store::getAll怎麽用?PHP Store::getAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Store的用法示例。


在下文中一共展示了Store::getAll方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: find

 static function find($searchId)
 {
     $stores_returned = Store::getAll();
     foreach ($stores_returned as $store) {
         if ($searchId == $store->getId()) {
             return $store;
         }
     }
 }
開發者ID:jschold,項目名稱:shoe_stores,代碼行數:9,代碼來源:Store.php

示例2: find

 static function find($id)
 {
     $db_stores = Store::getAll();
     foreach ($db_stores as $store) {
         if ($id == $store->getId()) {
             return $store;
         }
     }
     return null;
 }
開發者ID:ben-pritchard,項目名稱:Epicodus-Assessment---PHP-Many-to-Many-in-Silex,代碼行數:10,代碼來源:Store.php

示例3: testGetAll

 function testGetAll()
 {
     $name = "LuLus";
     $test_store = new Store($name);
     $test_store->save();
     $name2 = "Barts";
     $test_store2 = new Store($name);
     $test_store2->save();
     $result = Store::getAll();
     $this->assertEquals([$test_store, $test_store2], $result);
 }
開發者ID:alexMcosta,項目名稱:Shoes_Brands,代碼行數:11,代碼來源:StoreTest.php

示例4: find

 static function find($search_id)
 {
     $found_store = null;
     $all_stores = Store::getAll();
     foreach ($all_stores as $store) {
         if ($store->getId() == $search_id) {
             $found_store = $store;
         }
     }
     return $found_store;
 }
開發者ID:sammartinez,項目名稱:Silex-Bootstrap,代碼行數:11,代碼來源:Store.php

示例5: find

 static function find($search_id)
 {
     $found_brand = null;
     $brands = Store::getAll();
     foreach ($brands as $brand) {
         $brand_id = $brand->getId();
         if ($brand_id == $search_id) {
             $found_brand = $brand;
         }
     }
     return $found_brand;
 }
開發者ID:kellimargaret,項目名稱:Shoe_Stores,代碼行數:12,代碼來源:Brand.php

示例6: findByName

 static function findByName($search_name)
 {
     $found_store = null;
     $stores = Store::getAll();
     foreach ($stores as $store) {
         $store_name = $store->getName();
         if ($store_name == $search_name) {
             $found_store = $store;
         }
     }
     return $found_store;
 }
開發者ID:bdspen,項目名稱:ShoeStore,代碼行數:12,代碼來源:Store.php

示例7: test_deleteAll

 function test_deleteAll()
 {
     //Arrange
     $store_name = "Flying Shoes";
     $test_store = new Store($store_name);
     $test_store->save();
     //Act
     Store::deleteAll();
     $result = Store::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
開發者ID:kevintokheim,項目名稱:Shoe_Store,代碼行數:12,代碼來源:StoreTest.php

示例8: find

 static function find($search_id)
 {
     $found_store = NULL;
     $stores = Store::getAll();
     foreach ($stores as $store) {
         $store_id = $store->getId();
         if ($store_id == $search_id) {
             $found_store = $store;
         }
     }
     return $found_store;
 }
開發者ID:jlbethel,項目名稱:Shoes,代碼行數:12,代碼來源:Store.php

示例9: find

 static function find($search_id)
 {
     $found = null;
     $stores = Store::getAll();
     foreach ($stores as $store) {
         $store_id = $store->getId();
         if ($store_id == $search_id) {
             $found = $store;
         }
         //end of if
     }
     //end foreach
     return $found;
 }
開發者ID:CharlesAMoss,項目名稱:epic_Shoes,代碼行數:14,代碼來源:Store.php

示例10: test_delete

 function test_delete()
 {
     $test_name = "Nordstrom";
     $test_id = 1;
     $test_store = new store($test_name, $test_id);
     $test_store->save();
     $test_name2 = "Bloomingdales";
     $test_id2 = 2;
     $test_store2 = new Store($test_name2, $test_id2);
     $test_store2->save();
     $test_store->delete();
     $result = Store::getAll();
     $this->assertEquals([$test_store2], $result);
 }
開發者ID:juliocesardiaz,項目名稱:Shoes,代碼行數:14,代碼來源:StoreTest.php

示例11: testDeleteStore

 function testDeleteStore()
 {
     //Arrange
     $store_name = "Norstrom";
     $id = null;
     $test_store = new Store($store_name, $id);
     $test_store->save();
     $another_store = "Madewell";
     $test_store2 = new Store($another_store, $id);
     $test_store2->save();
     //Act
     $test_store->delete();
     $result = Store::getAll();
     //Assert
     $this->assertEquals([$test_store2], $result);
 }
開發者ID:kellimargaret,項目名稱:Shoe_Stores,代碼行數:16,代碼來源:StoreTest.php

示例12: testDeleteAll

 function testDeleteAll()
 {
     //Arrange
     $name = "Clogs-N-More";
     $id = 1;
     $test_store = new Store($name, $id);
     $test_store->save();
     $name2 = "Shoe Depot";
     $id2 = 1;
     $test_store2 = new Store($name2, $id2);
     $test_store2->save();
     //Act
     Store::deleteAll();
     $result = Store::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
開發者ID:bborealis,項目名稱:shoes,代碼行數:17,代碼來源:StoreTest.php

示例13: test_delete

 function test_delete()
 {
     //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
     $test_store->delete();
     $result = Store::getAll();
     //Assert
     $this->assertEquals($test_store2, $result[0]);
 }
開發者ID:jcubed22,項目名稱:Shoes,代碼行數:20,代碼來源:StoreTest.php

示例14: test_delete

 function test_delete()
 {
     //Arrange
     $id = null;
     $store_name = "New Seasons";
     $test_store = new Store($id, $store_name);
     $test_store->save();
     $id2 = null;
     $store_name2 = "Whole Foods";
     $test_store2 = new Store($id2, $store_name2);
     $test_store2->save();
     //Act
     $test_store->delete();
     $result = Store::getAll();
     //Assert
     $this->assertEquals($test_store2, $result[0]);
 }
開發者ID:sammartinez,項目名稱:shoes,代碼行數:17,代碼來源:StoreTest.php

示例15: testDeleteAll

 function testDeleteAll()
 {
     //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
     Store::deleteAll();
     $result = Store::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
開發者ID:bencasalino,項目名稱:cr4,代碼行數:19,代碼來源:StoreTest.php


注:本文中的Store::getAll方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。