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


PHP Brand::getName方法代碼示例

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


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

示例1: Brand

 function test_getName()
 {
     $test_name = "Helmut Lang";
     $test_id = 1;
     $test_brand = new Brand($test_name, $test_id);
     $result = $test_brand->getName();
     $this->assertEquals($test_name, $result);
 }
開發者ID:juliocesardiaz,項目名稱:Shoes,代碼行數:8,代碼來源:BrandTest.php

示例2: Brand

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

示例3: testUpdate

 function testUpdate()
 {
     $name = "Foot and feet";
     $test_brand = new Brand($name);
     $test_brand->save();
     $new_name = "Foot peddler";
     $test_brand->updateName($new_name);
     $this->assertEquals($new_name, $test_brand->getName());
 }
開發者ID:alexMcosta,項目名稱:Shoes_Brands,代碼行數:9,代碼來源:BrandTest.php

示例4: testGetName

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

示例5: Brand

 function test_getName()
 {
     //Arrange
     $name = "Nike";
     $test_brand = new Brand($name);
     //Act
     $result = $test_brand->getName();
     //Assert
     $this->assertEquals($name, $result);
 }
開發者ID:r-hills,項目名稱:Shoes,代碼行數:10,代碼來源:BrandTest.php

示例6: Brand

 function test_getName()
 {
     //Arrange
     $name = "Nike";
     $website = "http://www.nike.com";
     $test_brand = new Brand($name, $website);
     //Act
     $result = $test_brand->getName();
     //Assert
     $this->assertEquals($name, $result);
 }
開發者ID:ashlinaronin,項目名稱:shoes,代碼行數:11,代碼來源:BrandTest.php

示例7: testSetName

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

示例8: Brand

 function test_setName()
 {
     //Arrange
     $name = "Running";
     $id = 1;
     $test_brand = new Brand($name, $id);
     //Act
     $test_brand->setName("work");
     $result = $test_brand->getName();
     //Assert
     $this->assertEquals($result, "work");
 }
開發者ID:bdspen,項目名稱:ShoeStore,代碼行數:12,代碼來源:BrandTest.php

示例9: testUpdate

 function testUpdate()
 {
     // Arrange
     $brand_name = "Babbling Brooks";
     $test_Brand = new Brand($brand_name);
     $test_Brand->save();
     $new_name = "Gibberish Producing Brooks";
     // Act
     $test_Brand->update($new_name);
     $result = $test_Brand->getName();
     // Assert
     $this->assertEquals($new_name, $result);
 }
開發者ID:ben-pritchard,項目名稱:Epicodus-Assessment---PHP-Many-to-Many-in-Silex,代碼行數:13,代碼來源:brandTest.php

示例10: Brand

 function test_update()
 {
     //Arrange
     $name = "Nike";
     $id = null;
     $test_brand = new Brand($name, $id);
     $test_brand->save();
     $new_name = "Adidas";
     //Act
     $test_brand->update($new_name);
     //Assert
     $this->assertEquals($new_name, $test_brand->getName());
 }
開發者ID:jcubed22,項目名稱:Shoes,代碼行數:13,代碼來源:BrandTest.php

示例11: update

 public function update(Brand $brand, $errors = array())
 {
     $id = $brand->getId();
     $name = $this->db->quote($brand->getName());
     $description = $this->db->quote($brand->getDescription());
     $query = "UPDATE brand SET name = " . $name . ", description = " . $description . "WHERE id = " . $id;
     $data = $this->db->exec($query);
     if ($data) {
         $id = $this->db->lastInsertId();
         if ($id) {
             try {
                 $brand = $this->findByid($id);
                 return $brand;
             } catch (Exception $e) {
                 $errors[] = $e->getMessage();
                 return $errors;
             }
         } else {
             throw new Exception('Last insert error');
         }
     } else {
         throw new Exception('Update error');
     }
 }
開發者ID:dispix,項目名稱:dashboard,代碼行數:24,代碼來源:BrandManager.class.php

示例12: create

 /**
  * @param $name
  * @param $description
  * @param array $errors
  * @return object
  * @throws Exception
  */
 public function create($name, $description, $errors = array())
 {
     $category = new Brand($this->db);
     try {
         $category->setName($name);
     } catch (Exception $e) {
         $errors[] = $e->getMessage();
     }
     try {
         $category->setDescription($description);
     } catch (Exception $e) {
         $errors[] = $e->getMessage();
     }
     if (count($errors) == 0) {
         $name = $this->db->quote($category->getName());
         $description = $this->db->quote($category->getDescription());
         $query = "INSERT INTO category (name, description) VALUES(" . $name . ", " . $description . ")";
         $data = $this->db->exec($query);
         if ($data) {
             $id = $this->db->lastInsertId();
             if ($id) {
                 try {
                     $category = $this->findById($id);
                     return $category;
                 } catch (Exception $e) {
                     $errors[] = $e->getMessage();
                     return $errors;
                 }
             } else {
                 throw new Exception('Last insert error');
             }
         } else {
             throw new Exception('Insert error');
         }
     } else {
         return $errors;
     }
 }
開發者ID:dispix,項目名稱:dashboard,代碼行數:45,代碼來源:CategoryManager.class.php


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