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


PHP Client::update方法代码示例

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


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

示例1: purge

 /**
  * @return bool
  */
 public function purge()
 {
     $update = $this->client->createUpdate();
     $update->addDeleteQuery($this->deleteQuery);
     $update->addCommit();
     $result = $this->client->update($update);
     return 0 == $result->getStatus();
 }
开发者ID:starsw001,项目名称:solarium,代码行数:11,代码来源:Purger.php

示例2: Stylist

 function test_update()
 {
     $name = "Megan";
     $id = null;
     $test_stylist = new Stylist($name, $id);
     $test_stylist->save();
     $client_name = "Shawnee";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($id, $client_name, $stylist_id);
     $test_client->save();
     $new_client_name = "Katie Saccomanno";
     $test_client->update($new_client_name);
     $this->assertEquals("Katie Saccomanno", $test_client->getClientName());
 }
开发者ID:jschold,项目名称:Hair_Salon,代码行数:14,代码来源:ClientTest.php

示例3: testUpdate

 function testUpdate()
 {
     //Arrange
     $name = "Bob";
     $id = null;
     $test_stylist = new Stylist($name, $id);
     $test_stylist->save();
     $client_name = "Gertrude";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($client_name, $stylist_id, $id);
     $test_client->save();
     $new_client_name = "Billy";
     //Act
     $test_client->update($new_client_name);
     //Assert
     $this->assertEquals("Billy", $test_client->getName());
 }
开发者ID:r-hills,项目名称:Salon,代码行数:17,代码来源:ClientTest.php

示例4: testUpdate

 function testUpdate()
 {
     //Arrange
     $name = "Jackie";
     $test_stylist = new Stylist($name);
     $test_stylist->save();
     $name = "Sandra Jane";
     $phone = "542-334-0984";
     $style_choice = "The Rachel";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($name, $phone, $style_choice, $stylist_id);
     $test_client->save();
     $column_to_update = "style_choice";
     $new_information = "buffont";
     //Act
     $test_client->update($column_to_update, $new_information);
     //Assert
     $result = Client::getAll();
     $this->assertEquals("buffont", $result[0]->getStyleChoice());
 }
开发者ID:alexdbrown,项目名称:hair_salon,代码行数:20,代码来源:ClientTest.php

示例5: Stylist

 function test_update()
 {
     //Arrange
     $name = "Erin";
     $id = null;
     $test_stylist = new Stylist($name, $id);
     $test_stylist->save();
     $name = "George";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($name, $stylist_id, $id);
     $test_client->save();
     $new_name = "Jim";
     $new_test_client = new Client($new_name, $stylist_id, $test_client->getId());
     //Act
     $test_client->update($new_name);
     //Assert
     $this->assertEquals($test_client, $new_test_client);
 }
开发者ID:kylepratuch,项目名称:hair_salon,代码行数:18,代码来源:ClientTest.php

示例6: save_order

 public function save_order()
 {
     $client_array = $_POST['client_id'];
     $order_array = $_POST['order'];
     $client = new Client();
     foreach ($client_array as $key => $value) {
         $client_id = $value;
         $client_order = $order_array[$key];
         $client->update('Client', array('sequence' => $client_order), 'id=' . $client_id);
     }
     Flash::set('success', __('This client sequence has been saved.'));
     if ($_POST['album_id'] > 0) {
         redirect(get_url('client/view_album/' . $_POST['album_id']));
     } else {
         redirect(get_url('client'));
     }
 }
开发者ID:sindotnet,项目名称:cona,代码行数:17,代码来源:ClientController.php

示例7: testUpdate

 function testUpdate()
 {
     $name = "Bob";
     $phone = "555-555-5555";
     $stylist_id = 1;
     $test_client = new Client($name, $phone, $stylist_id);
     $new_name = "Stuart";
     $new_phone = "444-444-4444";
     $new_stylist_id = 2;
     $new_client = new Client($new_name, $new_phone, $new_stylist_id);
     $test_client->update($new_name, $new_phone, $new_stylist_id);
     $this->assertEquals($new_client, $test_client);
 }
开发者ID:CaseyH33,项目名称:Hair-Salon,代码行数:13,代码来源:ClientTest.php

示例8: testUpdateName

 function testUpdateName()
 {
     //Arrange
     $id = null;
     $name = "Martha Stewart";
     $phone = "(888) 888-8888";
     $next_visit = "2015-09-06";
     $stylist_id = 1;
     $test_client = new Client($id, $name, $phone, $next_visit, $stylist_id);
     $test_client->save();
     $new_name = "Katie Curic";
     $name = 'client_name';
     //Act
     $test_client->update($name, $new_name);
     //Assert
     $clients = Client::getAll();
     $result = $clients[0]->getClientName();
     $this->assertEquals($new_name, $result);
 }
开发者ID:kellimargaret,项目名称:Hair-Salon,代码行数:19,代码来源:ClientTest.php

示例9: testUpdateName

 function testUpdateName()
 {
     //Arrange
     $id = null;
     $client_name = "Nico";
     $stylist_id = 1;
     $test_client = new Client($id, $client_name, $stylist_id);
     $test_client->save();
     $new_client_name = "Nico Underground";
     $client_name = 'client_name';
     //Act
     $test_client->update($client_name, $new_client_name);
     //Assert
     $clients = Client::getAll();
     $result = $clients[0]->getClientName();
     $this->assertEquals($new_client_name, $result);
 }
开发者ID:austinblanchard,项目名称:hair_salon,代码行数:17,代码来源:ClientTest.php

示例10: create

 public function create()
 {
     if (isset($_POST['name']) && !empty($_POST['name'])) {
         $obj = new Client();
         $error = array();
         $obj->name = strip_tags($_POST['name']);
         $obj->addy = strip_tags($_POST['addy']);
         $obj->visible = $_POST['visible'];
         $obj->phone = $_POST['phone'];
         $obj->email = $_POST['email'];
         $obj->descr = $_POST['desc'];
         $obj->username = $_POST['username'];
         $phpFileUploadErrors = array(0 => 'There is no error, the file uploaded with success', 1 => 'The uploaded file exceeds the upload_max_filesize directive in php.ini', 2 => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form', 3 => 'The uploaded file was only partially uploaded', 4 => 'No file was uploaded', 6 => 'Missing a temporary folder', 7 => 'Failed to write file to disk.', 8 => 'A PHP extension stopped the file upload.');
         if (isset($_FILES['fupload']) && $_FILES['fupload']['error'] == 0) {
             //if file upload is set
             move_uploaded_file($_FILES['fupload']['tmp_name'], "../public/uploads/" . basename($_FILES['fupload']['name']));
             $image = new Imageresize();
             // an instance of image resize object
             $image->load("../public/uploads/" . basename($_FILES['fupload']['name']));
             //$image->image =;
             $image->resize(400, 400);
             $image->save("../public/uploads/" . basename($_FILES['fupload']['name']));
             //this section is needed to get the extension for image type in renaming the image
             if ($_FILES['fupload']['type'] == "image/gif") {
                 $ext = ".gif";
             }
             if ($_FILES['fupload']['type'] == "image/png") {
                 $ext = ".png";
             }
             if ($_FILES['fupload']['type'] == "image/jpeg") {
                 $ext = ".jpeg";
             }
             if ($_FILES['fupload']['type'] == "image/pjpeg") {
                 $ext = ".jpeg";
             }
             if ($_FILES['fupload']['type'] == "image/gif") {
                 $ext = ".gif";
             }
             if ($_FILES['fupload']['type'] == "image/jpg") {
                 $ext = ".jpg";
             }
             $new_name = uniqid() . "_" . time() . $ext;
             //new name for the image
             rename("../public/uploads/" . basename($_FILES['fupload']['name']), "../public/uploads/" . $new_name);
             $photo = $new_name;
             $obj->image = $photo;
         } else {
             //$applicant->img_url = $_REQUEST['imgvalue'];
             echo $phpFileUploadErrors[$_FILES['fupload']['error']];
             exit;
         }
         if ($_POST['password'] == $_POST['r_password']) {
             $obj->password = $_POST['password'];
         } else {
             array_push($error, "Password do not match");
         }
         if (empty($error)) {
             if ($obj->create()) {
                 $obj->main_id = Client::getID("CLT", $obj->id);
                 $obj->update();
                 return 1;
             } else {
                 return 2;
             }
         }
     }
 }
开发者ID:runningjack,项目名称:RobertJohnson,代码行数:67,代码来源:clients_model.php

示例11: Stylist

 function test_update()
 {
     $name = "Sally";
     $phone = "555-555-5555";
     $id = null;
     $test_stylist = new Stylist($name, $phone, $id);
     $test_stylist->save();
     $name = "Maggie";
     $phone = "123-321-1234";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($name, $phone, $id, $stylist_id);
     $test_client->save();
     $new_name = "George";
     $new_phone = "123-456-7890";
     $test_client->update($new_name, $new_phone);
     $this->assertEquals("George", $test_client->getName());
     $this->assertEquals("123-456-7890", $test_client->getPhone());
 }
开发者ID:bborealis,项目名称:Hair_Salon,代码行数:18,代码来源:ClientTest.php

示例12: Client

 function test_update()
 {
     //Arrange
     $client_name = "Paco";
     $id = null;
     $stylist_id = 2;
     $test_client = new Client($client_name, $id, $stylist_id);
     $test_client->save();
     $new_client_name = "Pablo";
     //Act
     $test_client->update($new_client_name);
     //Assert
     $this->assertEquals("Pablo", $test_client->getClientName());
 }
开发者ID:kennygrage,项目名称:epicSalon,代码行数:14,代码来源:ClientTest.php

示例13: Stylist

 function test_update()
 {
     //Arrange
     $name = "Becky";
     $id = null;
     $test_stylist = new Stylist($name, $id);
     $test_stylist->save();
     $client = "Mark";
     $phone = "123-456-7890";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($client, $phone, $stylist_id, $id);
     $test_client->save();
     $new_client_name = "Peter";
     //Act
     $test_client->update($new_client_name);
     //Assert
     $this->assertEquals("Peter", $test_client->getName());
 }
开发者ID:sammartinez,项目名称:hair_salon,代码行数:18,代码来源:ClientTest.php

示例14: Stylist

 function test_update()
 {
     //Arrange
     $stylist_name = "Ed Scissorhands";
     $id = null;
     $test_stylist = new Stylist($stylist_name, $id);
     $test_stylist->save();
     $client_name = "Bed Head";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($client_name, $id, $stylist_id);
     $test_client->save();
     $new_name = "Hairy Carey";
     //Act
     $test_client->update($new_name);
     //Assert
     $this->assertEquals("Hairy Carey", $test_client->getClientName());
 }
开发者ID:JordanNavratil,项目名称:Hair_salon,代码行数:17,代码来源:ClientTest.php

示例15: saveClient

 public function saveClient($id, $coffees, $freeCups, $name, $middlename, $lastname, $telephone, $email, $comment)
 {
     $db = $this->db;
     $newClient = new Client();
     $newClient->name = $name;
     $newClient->middlename = $middlename;
     $newClient->lastname = $lastname;
     $newClient->coffees = $coffees;
     $newClient->freeCups = $freeCups;
     $newClient->telephone = $telephone;
     $newClient->email = $email;
     $newClient->registred = date('Y-m-d');
     $newClient->comment = $comment;
     if (0 != $id) {
         $newClient->id = $id;
         $newClient->update($db);
     } else {
         $newClient->save($db);
     }
 }
开发者ID:eepletnev,项目名称:way-cup-erp,代码行数:20,代码来源:crm_manager.php


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