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


PHP Brand::getId方法代碼示例

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


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

示例1: Brand

 function test_getId()
 {
     $name = "Nike";
     $id = 1;
     $test_brand = new Brand($name, $id);
     $result = $test_brand->getId();
     $this->assertEquals(true, is_numeric($result));
 }
開發者ID:jeffaustin81,項目名稱:shoe_store,代碼行數:8,代碼來源:BrandTest.php

示例2: getId

 /**
  * Get the Phone Model id from database
  * @param string|int $brand
  * @param string $phoneModel
  * @return int
  */
 public static function getId($brand, $phoneModel)
 {
     $brandId = is_numeric($brand) ? (int) $brand : \Brand::getId($brand);
     $model = static::fetchOne(array('brand_id' => $brandId, 'name' => $phoneModel));
     if ($model === false) {
         $model = static::create(array('brand_id' => $brandId, 'name' => $phoneModel));
     }
     return $model->id;
 }
開發者ID:nkammah,項目名稱:Crash-Analytics,代碼行數:15,代碼來源:Model.php

示例3: getId

 /**
  * Get the product ID from database
  * @param string|int $brand
  * @param string $productName
  * @return int
  */
 public static function getId($brand, $productName)
 {
     $brandId = is_numeric($brand) ? (int) $brand : \Brand::getId($brand);
     $product = static::fetchOne(array('brand_id' => $brandId, 'name' => $productName));
     if ($product === false) {
         $product = static::create(array('brand_id' => $brandId, 'name' => $productName));
     }
     return $product->id;
 }
開發者ID:nkammah,項目名稱:Crash-Analytics,代碼行數:15,代碼來源:Product.php

示例4: getBrandId

 /**
  * Get the brand ID
  * @param string $brand
  * @return int
  */
 private function getBrandId($brand)
 {
     if ($brand === null || trim($brand) == '') {
         return null;
     }
     if (!isset($this->brandIds[$brand])) {
         $this->brandIds[$brand] = Brand::getId($brand);
     }
     return $this->brandIds[$brand];
 }
開發者ID:nkammah,項目名稱:Crash-Analytics,代碼行數:15,代碼來源:Calculation.php

示例5: insert

 public function insert(Category $category, Subcategory $subcategory, Brand $brand, Item $item)
 {
     //        $sql = "INSERT INTO item values (null, 'aalluu', 'asdfasd',true,true, '2015-10-10','asdfasf', 'asdfasd', 1, 1 ,1, 1)";
     $sql = "INSERT INTO item values (null, '" . $item->getTitle() . "','" . $item->getDetail() . "',true,false, '" . $item->getDate() . "', '" . $item->getLocation() . "','asfasf'," . $category->getId() . "," . $subcategory->getId() . ", 1 ," . $brand->getId() . ")";
     echo $sql;
     if ($this->conn->query($sql) === TRUE) {
         echo "Insert operation successful";
     } else {
         echo "Error inserting: ";
     }
 }
開發者ID:ppandey224,項目名稱:manaslu,代碼行數:11,代碼來源:ReportService.php

示例6: testFind

 function testFind()
 {
     $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::find($test_brand->getId());
     $this->assertEquals($test_brand, $result);
 }
開發者ID:CaseyH33,項目名稱:Shoes,代碼行數:11,代碼來源:BrandTest.php

示例7: testFind

 function testFind()
 {
     $name = "Clides";
     $test_brand = new Brand($name);
     $test_brand->save();
     $name2 = "Marthas";
     $test_brand2 = new Brand($name2);
     $test_brand2->save();
     $result = Brand::find($test_brand->getId());
     $this->assertEquals($test_brand, $result);
 }
開發者ID:alexMcosta,項目名稱:Shoes_Brands,代碼行數:11,代碼來源:BrandTest.php

示例8: testGetId

 function testGetId()
 {
     //Arrange
     $name = "addidas";
     $id = 1;
     $test_brand = new Brand($name, $id);
     //Act
     $result = $test_brand->getId();
     //Assert
     $this->assertEquals($id, $result);
 }
開發者ID:bencasalino,項目名稱:cr4,代碼行數:11,代碼來源:BrandTest.php

示例9: Brand

 function test_find()
 {
     //Arrange
     $brand_name = "Nike";
     $test_brand = new Brand($id, $brand_name);
     $test_brand->save();
     $brand_name2 = "Adidas";
     $test_brand2 = new Brand($id, $brand_name2);
     $test_brand2->save();
     //Act
     $result = Brand::find($test_brand->getId());
     //Assert
     $this->assertEquals($test_brand, $result);
 }
開發者ID:sammartinez,項目名稱:Silex-Bootstrap,代碼行數:14,代碼來源:BrandTest.php

示例10: testFind

 function testFind()
 {
     //Arrange
     $brand_name = "Nike";
     $test_brand = new Brand($brand_name, $id);
     $test_brand->save();
     $brand_name2 = "Reebok";
     $test_brand2 = new Brand($brand_name2, $id2);
     $test_brand2->save();
     //Act
     $result = Brand::find($test_brand2->getId());
     //assert
     $this->assertEquals($test_brand2, $result);
 }
開發者ID:jtorrespdx,項目名稱:Shoe_stores,代碼行數:14,代碼來源:BrandTest.php

示例11: testFind

 function testFind()
 {
     //Arrange
     $brand_name = "Feiyue";
     $test_brand = new Brand($brand_name, $id = null);
     $test_brand->save();
     $brand_name2 = "Kailai";
     $test_brand2 = new Brand($brand_name2, $id = null);
     $test_brand2->save();
     //Act
     $result = Brand::find($test_brand->getId());
     //Assert
     $this->assertEquals($test_brand, $result);
 }
開發者ID:slmaturen,項目名稱:shoe_store,代碼行數:14,代碼來源:BrandTest.php

示例12: delete

 public function delete(Brand $brand)
 {
     $query = "DELETE FROM brand WHERE id = " . $brand->getId();
     $data = $this->db->exec($query);
     if ($data) {
         return true;
     } else {
         throw new Exception('Delete error');
     }
 }
開發者ID:dispix,項目名稱:dashboard,代碼行數:10,代碼來源:BrandManager.class.php

示例13: Brand

 function test_brand_find()
 {
     //Arrange
     $brand_name = "Nike";
     $id1 = 1;
     $test_brand = new Brand($brand_name, $id1);
     $test_brand->save();
     $brand_name2 = "Converse";
     $id2 = 2;
     $test_brand2 = new Brand($brand_name2, $id2);
     $test_brand2->save();
     //Act
     $result = Brand::find($test_brand->getId());
     //Assert
     $this->assertEquals($test_brand, $result);
 }
開發者ID:CharlesAMoss,項目名稱:epic_Shoes,代碼行數:16,代碼來源:BrandTest.php

示例14: Brand

 function test_find()
 {
     //Arrange
     $brand_name = "La Sportiva";
     $test_brand = new Brand($brand_name);
     $test_brand->save();
     $brand_name2 = "Evolv";
     $test_brand2 = new Brand($brand_name2);
     $test_brand2->save();
     //Act
     $result = Brand::find($test_brand->getId());
     //Assert
     $this->assertEquals($test_brand, $result);
 }
開發者ID:jlbethel,項目名稱:Shoes,代碼行數:14,代碼來源:BrandTest.php

示例15: Brand

 function test_find()
 {
     //Arrange
     $name = "Nike";
     $website = "http://www.nike.com";
     $test_brand = new Brand($name, $website);
     $test_brand->save();
     $name2 = "Adidas";
     $website2 = "http://www.adidas.com";
     $test_brand2 = new Brand($name2, $website2);
     $test_brand2->save();
     //Act
     $result = Brand::find($test_brand2->getId());
     //Assert
     $this->assertEquals($test_brand2, $result);
 }
開發者ID:ashlinaronin,項目名稱:shoes,代碼行數:16,代碼來源:BrandTest.php


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