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


PHP Brand::update方法代碼示例

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


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

示例1: testUpdate

 function testUpdate()
 {
     $brand_name = "dr.martens";
     $new_brand = new Brand($brand_name);
     $new_brand->save();
     $new_brand->setBrandName("doc martens");
     $new_brand->update();
     $result = Brand::getAll();
     $this->assertEquals($new_brand, $result[0]);
 }
開發者ID:jschold,項目名稱:shoe_stores,代碼行數:10,代碼來源:BrandTest.php

示例2: Brand

 function test_update()
 {
     $test_name = "Helmut Lang";
     $test_id = 1;
     $test_brand = new Brand($test_name, $test_id);
     $test_brand->save();
     $new_name = "Y-3";
     $test_brand->update($new_name);
     $result = Brand::getAll();
     $this->assertEquals($new_name, $result[0]->getName());
 }
開發者ID:juliocesardiaz,項目名稱:Shoes,代碼行數:11,代碼來源:BrandTest.php

示例3: 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

示例4: 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

示例5: testUpdate

 function testUpdate()
 {
     //Arrange
     $brand_name = "Sketchers";
     $test_brand = new Brand($brand_name);
     $test_brand->save();
     $new_name = "Vans";
     //Act
     $test_brand->update($new_name);
     //Assert
     $this->assertEquals($new_name, $test_brand->getBrandName());
 }
開發者ID:kellimargaret,項目名稱:Shoe_Stores,代碼行數:12,代碼來源:BrandTest.php

示例6: testUpdate

 function testUpdate()
 {
     //Arrange
     $brand_name = "Nike";
     $id = 1;
     $test_brand = new Brand($brand_name, $id);
     $test_brand->save();
     $new_brand_name = "Fila";
     //Act
     $test_brand->update($new_brand_name);
     //Assert
     $this->assertEquals('Fila', $test_brand->getBrandName());
 }
開發者ID:jtorrespdx,項目名稱:Shoe_stores,代碼行數:13,代碼來源:BrandTest.php

示例7: function

        echo "<script>window.location='../../'</script>";
    }
});
// $app->post('/brands', function() use($brand, $app) {
//   $request = $app->request();
//   $body = $request->getBody();
//   $data = json_decode($body);
//   $brand->insert($data);
// });
$app->put('/brands/:id', function ($id) use($brand, $app) {
    if (isset($_SESSION['app']) && isset($_COOKIE['app'])) {
        $request = $app->request();
        $body = $request->getBody();
        $data = json_decode($body);
        $data->id = $id;
        $brand->update($data);
    } else {
        echo "<script>window.location='../../'</script>";
    }
});
$app->get('/users/:id', function ($id) use($user) {
    if (isset($_SESSION['app']) && isset($_COOKIE['app'])) {
        $user->getUser($id);
    } else {
        echo "<script>window.location='../../'</script>";
    }
});
$app->put('/users/:id', function ($id) use($user, $app) {
    if (isset($_SESSION['app']) && isset($_COOKIE['app'])) {
        $request = $app->request();
        $body = $request->getBody();
開發者ID:jhonrsalcedo,項目名稱:BSG,代碼行數:31,代碼來源:index.php


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