当前位置: 首页>>代码示例>>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;未经允许,请勿转载。