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


PHP Client::delete方法代码示例

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


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

示例1: postCreate

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function postCreate()
 {
     // Declare the rules for the form validation
     $rules = array('name' => 'required|min:3', 'description' => 'required|min:3', 'email' => 'required|min:3', 'callback' => 'required|min:3', 'website' => 'required|min:3');
     // Validate the inputs
     $validator = Validator::make(Input::all(), $rules);
     // Check if the form validates with success
     if ($validator->passes()) {
         // Create a new blog post
         $user = Auth::user();
         // Update the blog post data
         $this->client->name = Input::get('name');
         $this->client->id = $this->keygen();
         $this->client->secret = $this->keygen();
         //$this->client->user_id          = $user->id;
         // Was the blog post created?
         if ($this->client->save()) {
             //Create Endpoint Object
             $endpoint = new ClientEndpoint(array('redirect_uri' => Input::get('callback')));
             $metadata = array(new ClientMetadata(array('key' => 'slug', 'value' => Str::slug(Input::get('name')))), new ClientMetadata(array('key' => 'description', 'value' => Str::slug(Input::get('description')))), new ClientMetadata(array('key' => 'email', 'value' => Str::slug(Input::get('email')))), new ClientMetadata(array('key' => 'website', 'value' => Str::slug(Input::get('website')))));
             if (!$this->client->endpoint()->save($endpoint)) {
                 //delete client
                 $id = $this->client->id;
                 $this->client->delete();
                 // Was the blog post deleted?
                 $client = Client::find($id);
                 if (empty($client)) {
                     // Redirect to the blog post create page
                     return Redirect::to('admin/clients/create')->with('error', Lang::get('admin/clients/messages.create.endpoint_error'));
                 }
             }
             if (!$this->client->metadata()->saveMany($metadata)) {
                 //delete client
                 $id = $this->client->id;
                 $this->client->delete();
                 // Was the blog post deleted?
                 $client = Client::find($id);
                 if (empty($client)) {
                     // Redirect to the blog post create page
                     return Redirect::to('admin/clients/create')->with('error', Lang::get('admin/clients/messages.create.metadata_error'));
                 }
             }
             // Redirect to the new blog post page
             return Redirect::to('admin/clients/' . $this->client->id . '/edit')->with('success', Lang::get('admin/clients/messages.create.success'));
         }
         // Redirect to the blog post create page
         return Redirect::to('admin/clients/create')->with('error', Lang::get('admin/clients/messages.create.error'));
     }
     // Form validation failed
     return Redirect::to('admin/clients/create')->withInput()->withErrors($validator);
 }
开发者ID:otherjohn,项目名称:govid,代码行数:56,代码来源:AdminClientsController.php

示例2: delete

 public function delete($options = [])
 {
     $data = Client::delete(static::endpoint() . '/' . $this->id(), $options);
     if (count($data) > 0) {
         $data = json_decode($data, true);
     }
     return $data;
 }
开发者ID:vicioux,项目名称:apisdk,代码行数:8,代码来源:riq_obj.php

示例3: supprimer

function supprimer($ref)
{
    $client = new Client();
    $client->charger_ref($ref);
    $client->delete();
    ActionsModules::instance()->appel_module("supcli", $client);
    redirige("client.php");
}
开发者ID:anti-conformiste,项目名称:thelia1,代码行数:8,代码来源:client_visualiser.php

示例4: testExceedMaxJobSize

 public function testExceedMaxJobSize()
 {
     $this->subject->put(0, 0, 100, str_repeat('0', 65536 - 1));
     $result = $this->subject->reserve(5);
     $this->subject->delete($result['id']);
     $this->assertEquals(65536 - 1, strlen($result['body']));
     $this->subject->put(0, 0, 100, str_repeat('0', 65536));
     $result = $this->subject->reserve(1);
     $this->assertFalse($result);
 }
开发者ID:samjarrett,项目名称:beanstalk,代码行数:10,代码来源:ProducerTest.php

示例5: delete

 public static function delete($subscription_id, $subscription_adjustment_id, $client = null)
 {
     if ($client == null) {
         $client = new Client();
     }
     $response = $client->delete(sprintf(self::$SUBSCRIPTION_ADJUSTMENT_PATH, $subscription_id) . $subscription_adjustment_id);
     if ($response[0] == 200) {
         return new self($response[1], $client);
     } else {
         return $response[2];
     }
 }
开发者ID:apruve,项目名称:apruve-php,代码行数:12,代码来源:SubscriptionAdjustment.php

示例6: cancelInvitation

 public function cancelInvitation($pid, $email)
 {
     $result = $this->client->get("/gdc/projects/{$pid}/invitations");
     foreach ($result['invitations'] as $r) {
         if (strtolower($r['invitation']['content']['email']) != strtolower($email)) {
             continue;
         }
         if ($r['invitation']['content']['status'] == 'CANCELED') {
             continue;
         }
         $this->client->delete($r['invitation']['links']['self']);
     }
 }
开发者ID:keboola,项目名称:gooddata-php-client,代码行数:13,代码来源:Projects.php

示例7: Client

 function test_delete()
 {
     $stylist_id = 2;
     $client_name = "Shawnee";
     $id = null;
     $test_client = new Client($id, $client_name, $stylist_id);
     $test_client->save();
     $client_name2 = "Katie";
     $test_client2 = new Client($id, $client_name, $stylist_id);
     $test_client2->save();
     $test_client->delete();
     $this->assertEquals([$test_client2], Client::getAll());
 }
开发者ID:jschold,项目名称:Hair_Salon,代码行数:13,代码来源:ClientTest.php

示例8: testDelete

 function testDelete()
 {
     //Arrange
     $name = "jill";
     $test_stylist = new Stylist($name);
     $test_stylist->save();
     $name = "joe";
     $phone = "123-456-7890";
     $style_choice = "shave";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($name, $phone, $style_choice, $stylist_id);
     $test_client->save();
     $name2 = "kramer";
     $phone2 = "123-456-7890";
     $style_choice2 = "bowl cut";
     $test_client2 = new Client($name2, $phone2, $style_choice2, $stylist_id);
     $test_client2->save();
     //Act
     $test_client->delete();
     //Assert
     $this->assertEquals([$test_client2], Client::getAll());
 }
开发者ID:bencasalino,项目名称:cr3,代码行数:22,代码来源:CleintTest.php

示例9: Client

 function test_client_delete()
 {
     //Arrange
     $style = "Thai";
     $test_cuisine = new Client($style);
     $test_cuisine->save();
     $name = "Pok Pok";
     $category_id = $test_cuisine->getId();
     $test_client = new Client($name, $category_id);
     $test_client->save();
     $name2 = "Dicks";
     $category_id2 = $test_cuisine->getId();
     $test_client2 = new Client($name2, $category_id);
     $test_client2->save();
     //Act
     $test_client->delete();
     //Assert
     $this->assertEquals([$test_client2], Client::getAll());
 }
开发者ID:umamiMike,项目名称:salon_app,代码行数:19,代码来源:clientTest.php

示例10: Stylist

 function test_delete()
 {
     //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();
     $name2 = "Judy";
     $test_client2 = new Client($name2, $stylist_id, $id);
     $test_client2->save();
     //Act
     $test_client2->delete();
     //Assert
     $this->assertEquals([$test_client], Client::getAll());
 }
开发者ID:kylepratuch,项目名称:hair_salon,代码行数:19,代码来源:ClientTest.php

示例11: deleteUser

 public function deleteUser($uid)
 {
     $this->client->delete("/gdc/account/profile/{$uid}");
 }
开发者ID:keboola,项目名称:gooddata-php-client,代码行数:4,代码来源:Users.php

示例12: Client

     }
     break;
 case $ACTION_clientSave:
     if (isset($_POST["client"])) {
         $_SESSION["client"] = $_POST["client"];
     }
     $tempClient = new Client($_POST["client"], $_POST["client_name_field"], $_POST["client_address_field"]);
     $tempClient->save();
     break;
 case $ACTION_clientCreate:
     $tempClient = new Client($_POST["client_name_field"], $_POST["client_address_field"]);
     $tempClient->create();
     break;
 case $ACTION_clientDelete:
     $tempClient = new Client($_GET["client"]);
     $tempClient->delete();
     $_SESSION["client"] = -1;
     break;
 case $ACTION_changeRole:
     // besoin des faire des verif savoir si l'utilisateur a bien le droit de change de ce role
     if (isset($_GET["role"])) {
         $_SESSION["systemData"]->setUserRole($_GET["role"]);
     }
     break;
 case $ACTION_showResult:
     $listeResultat = null;
     if (isset($_POST["search_type_select"])) {
         if ($_POST["search_type_select"] == 0) {
             $listeResultat[0] = 0;
             $active = false;
             if (isset($_POST["checkbox_filter_state_ongoing"]) && $_POST["checkbox_filter_state_ongoing"] == "check") {
开发者ID:truffrose,项目名称:projetGL,代码行数:31,代码来源:controller.php

示例13: testDelete

 function testDelete()
 {
     $name = "Bob";
     $phone = "555-555-5555";
     $stylist_id = 1;
     $test_client = new Client($name, $phone, $stylist_id);
     $test_client->save();
     $name2 = "Kevin";
     $phone2 = "444-444-4444";
     $test_client2 = new Client($name2, $phone2, $stylist_id);
     $test_client2->save();
     $test_client->delete();
     $this->assertEquals([$test_client2], Client::getAll());
 }
开发者ID:CaseyH33,项目名称:Hair-Salon,代码行数:14,代码来源:ClientTest.php

示例14: array

    $client->save();
    $stylist = Stylist::find($stylist_id);
    return $app['twig']->render('stylist.html.twig', array('stylist' => $stylist, 'client' => $stylist->getClient()));
});
$app->post("/stylists", function () use($app) {
    $stylist = new Stylist($_POST['name']);
    $stylist->save();
    return $app['twig']->render('index.html.twig', array('stylists' => Stylist::getAll()));
});
$app->post("/delete_stylists", function () use($app) {
    //Clients::deleteAll();
    Stylist::deleteAll();
    return $app['twig']->render('index.html.twig', array('stylists' => Stylist::getAll()));
});
$app->post("/delete_client", function () use($app) {
    $category_id = $_POST['stylist_id'];
    Client::delete($stylist_id);
    return $app['twig']->render('index.html.twig', array('stylists' => Stylist::getAll()));
});
$app->get("/all_clients", function () use($app) {
    return $app['twig']->render('all_clients.html.twig', array('clients' => Client::getAll(), 'stylists' => Stylist::getAll()));
});
$app->post("/client", function () use($app) {
    $name = $_POST['name'];
    $stylist_id = $_POST['stylist_id'];
    $client = new Client($name, $stylist_id);
    $client->save();
    $stylist = Stylist::find($stylist_id);
    return $app['twig']->render('stylist.html.twig', array('stylist' => $stylist, 'clients' => Client::getAll()));
});
return $app;
开发者ID:CharlesAMoss,项目名称:epic_HairSalon,代码行数:31,代码来源:app.php

示例15: Stylist

 function test_delete()
 {
     //arrange
     $stylist_name = "Lisa";
     $id = null;
     $test_stylist = new Stylist($stylist_name, $id);
     $test_stylist->save();
     $client_name = "Alfred";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($client_name, $id, $stylist_id);
     $test_client->save();
     $client_name2 = "Ludacris";
     $stylist_id = $test_stylist->getId();
     $test_client2 = new Client($client_name2, $id, $stylist_id);
     $test_client2->save();
     $test_client->delete();
     //assert
     $this->assertEquals([$test_client2], Client::getAll());
 }
开发者ID:nathanhwyoung,项目名称:hair_salon_app,代码行数:19,代码来源:ClientTest.php


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