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


PHP Brand::getAll方法代码示例

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


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

示例1: find

 static function find($searchId)
 {
     $brands_returned = Brand::getAll();
     foreach ($brands_returned as $brand) {
         if ($searchId == $brand->getId()) {
             return $brand;
         }
     }
 }
开发者ID:jschold,项目名称:shoe_stores,代码行数:9,代码来源:Brand.php

示例2: find

 static function find($id)
 {
     $db_brands = Brand::getAll();
     foreach ($db_brands as $brand) {
         if ($id == $brand->getId()) {
             return $brand;
         }
     }
     return null;
 }
开发者ID:ben-pritchard,项目名称:Epicodus-Assessment---PHP-Many-to-Many-in-Silex,代码行数:10,代码来源:Brand.php

示例3: testGetAll

 function testGetAll()
 {
     $name = "LuLus";
     $test_brand = new Brand($name);
     $test_brand->save();
     $name2 = "Barts";
     $test_brand2 = new Brand($name);
     $test_brand2->save();
     $result = Brand::getAll();
     $this->assertEquals([$test_brand, $test_brand2], $result);
 }
开发者ID:alexMcosta,项目名称:Shoes_Brands,代码行数:11,代码来源:BrandTest.php

示例4: find

 static function find($search_id)
 {
     $found_brand = null;
     $all_brands = Brand::getAll();
     foreach ($all_brands as $brand) {
         if ($brand->getId() == $search_id) {
             $found_brand = $brand;
         }
     }
     return $found_brand;
 }
开发者ID:sammartinez,项目名称:shoes,代码行数:11,代码来源:Brand.php

示例5: testGetAll

 function testGetAll()
 {
     $brand_name = "Air Jordan";
     $test_brand = new Brand($brand_name);
     $test_brand->save();
     $brand_name2 = "Nike";
     $test_brand2 = new Brand($brand_name2);
     $test_brand2->save();
     $result = Brand::getAll();
     $this->assertEquals([$test_brand, $test_brand2], $result);
 }
开发者ID:CaseyH33,项目名称:Shoes,代码行数:11,代码来源:BrandTest.php

示例6: test_delete

 function test_delete()
 {
     $name = "Nike";
     $test_brand = new Brand($name, $id);
     $test_brand->save();
     $name2 = "Adidas";
     $test_brand2 = new Brand($name2, $id);
     $test_brand2->save();
     $test_brand->delete();
     $this->assertEquals([$test_brand2], Brand::getAll());
 }
开发者ID:jeffaustin81,项目名称:shoe_store,代码行数:11,代码来源:BrandTest.php

示例7: Brand

 function test_deleteAll()
 {
     //Arrange
     $brand_name = "Nike";
     $test_brand = new Brand($brand_name);
     $test_brand->save();
     //Act
     Brand::deleteAll();
     $result = $test_brand->getAll();
     //Assert
     $this->assertEquals([], $result);
 }
开发者ID:kevintokheim,项目名称:Shoe_Store,代码行数:12,代码来源:BrandTest.php

示例8: find

 static function find($search_id)
 {
     $found_store = null;
     $brands = Brand::getAll();
     foreach ($brands as $store) {
         $store_id = $store->getId();
         if ($store_id == $search_id) {
             $found_store = $store;
         }
     }
     return $found_store;
 }
开发者ID:bborealis,项目名称:shoes,代码行数:12,代码来源:Brand.php

示例9: findByName

 static function findByName($search_name)
 {
     $found_brand = null;
     $brands = Brand::getAll();
     foreach ($brands as $brand) {
         $brand_name = $brand->getName();
         if ($brand_name == $search_name) {
             $found_brand = $brand;
         }
     }
     return $found_brand;
 }
开发者ID:bdspen,项目名称:ShoeStore,代码行数:12,代码来源:Brand.php

示例10: test_delete

 function test_delete()
 {
     $test_name = "Helmut Lang";
     $test_id = 1;
     $test_brand = new Brand($test_name, $test_id);
     $test_brand->save();
     $test_name2 = "Y-3";
     $test_id2 = 2;
     $test_brand2 = new Brand($test_name2, $test_id2);
     $test_brand2->save();
     $test_brand->delete();
     $result = Brand::getAll();
     $this->assertEquals([$test_brand2], $result);
 }
开发者ID:juliocesardiaz,项目名称:Shoes,代码行数:14,代码来源:BrandTest.php

示例11: find

 static function find($search_id)
 {
     $found = null;
     $brands = Brand::getAll();
     foreach ($brands as $brand) {
         $brand_id = $brand->getId();
         if ($brand_id == $search_id) {
             $found = $brand;
         }
         //end of if
     }
     //end foreach
     return $found;
 }
开发者ID:CharlesAMoss,项目名称:epic_Shoes,代码行数:14,代码来源:Brand.php

示例12: download

 public function download()
 {
     header('Cache-Control: no-cache, must-revalidate');
     header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
     header('Content-type: application/json');
     header('Content-Description: File Transfer');
     header('Content-Type: application/octet-stream');
     header('Content-Disposition: attachment; filename=findguidelines.json');
     header('Content-Transfer-Encoding: binary');
     header('Connection: Keep-Alive');
     header('Pragma: public');
     $brands = Brand::getAll();
     echo json_encode($brands);
 }
开发者ID:Aqro,项目名称:findguidelines,代码行数:14,代码来源:FindGuidelinesController.php

示例13: testDeleteAll

 function testDeleteAll()
 {
     //Arrange
     $brand_name = "Super Kicks";
     $test_brand = new Brand($brand_name);
     $test_brand->save();
     $brand_name2 = "Cool Shoes";
     $test_brand2 = new Brand($brand_name2);
     $test_brand->save();
     //Act
     Brand::deleteAll();
     $result = Brand::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
开发者ID:kylepratuch,项目名称:Shoe_Store,代码行数:15,代码来源:BrandTest.php

示例14: test_delete

 function test_delete()
 {
     //Arrange
     $name = "Nike";
     $test_brand = new Brand($name);
     $test_brand->save();
     $name2 = "Adidas";
     $test_brand2 = new Brand($name2);
     $test_brand2->save();
     //Act
     $test_brand->delete();
     $result = Brand::getAll();
     //Assert
     $this->assertEquals([$test_brand2], $result);
 }
开发者ID:r-hills,项目名称:Shoes,代码行数:15,代码来源:BrandTest.php

示例15: testDeleteBrand

 function testDeleteBrand()
 {
     //Arrange
     $brand_name = "Sketchers";
     $test_brand = new Brand($brand_name);
     $test_brand->save();
     $another_brand = "Doc Martin";
     $test_brand2 = new Brand($another_brand);
     $test_brand2->save();
     //Act
     $test_brand->delete();
     $result = Brand::getAll();
     //Assert
     $this->assertEquals([$test_brand2], $result);
 }
开发者ID:kellimargaret,项目名称:Shoe_Stores,代码行数:15,代码来源:BrandTest.php


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