本文整理汇总了PHP中Client::deleteAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::deleteAll方法的具体用法?PHP Client::deleteAll怎么用?PHP Client::deleteAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client
的用法示例。
在下文中一共展示了Client::deleteAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testDeleteAll
function testDeleteAll()
{
//Arrange
$id = null;
$name = "Nico";
$stylist_id = 1;
$test_client = new Client($id, $client_name, $stylist_id);
$test_client->save();
$name2 = "Al";
$stylist_id2 = 2;
$test_client2 = new Client($id, $client_name2, $stylist_id2);
$test_client2->save();
//Act
Client::deleteAll();
//Assert
$result = Client::getAll();
$this->assertEquals([], $result);
}
示例2: test_deleteAll
function test_deleteAll()
{
//Arrange
$stylist_name = "Bob";
$id = null;
$test_stylist = new Stylist($stylist_name, $id);
$test_stylist->save();
$client_name = "Joe";
$stylist_id = $test_stylist->getId();
$test_client = new Client($client_name, $id, $stylist_id);
$test_client->save();
$client_name2 = "Harry";
$test_client2 = new Client($client_name2, $id, $stylist_id);
$test_client2->save();
//Act
Client::deleteAll();
//Assert
$result = Client::getAll();
$this->assertEquals([], $result);
}
示例3: test_client_deleteAll
function test_client_deleteAll()
{
//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 = "Mai Thai";
$category_id = $test_cuisine->getId();
$test_client2 = new Client($name2, $category_id);
$test_client2->save();
//Act
Client::deleteAll();
//Assert
$result = Client::getAll();
$this->assertEquals([], $result);
}
示例4: testDeleteAll
function testDeleteAll()
{
//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();
$name2 = "Jennifer Lopez";
$phone2 = "(609) 999-9999";
$next_visit2 = "2015-10-12";
$stylist_id2 = 2;
$test_client2 = new Client($id, $name2, $phone2, $next_visit2, $stylist_id2);
$test_client2->save();
//Act
Client::deleteAll();
//Assert
$result = Client::getAll();
$this->assertEquals([], $result);
}
示例5: testDeleteAll
function testDeleteAll()
{
//Arrange
$stylist_name = "Gandalf the Gray";
$test_stylist = new Stylist($stylist_name, $id = null);
$test_stylist->save();
$client_name = "Samwise";
$stylist_id = $test_stylist->getId();
$test_client = new Client($client_name, $id = null, $stylist_id);
$test_client->save();
$client_name2 = "Arwen";
$test_client2 = new Client($client_name2, $id = null, $stylist_id);
$test_client2->save();
//Act
Client::deleteAll();
//Assert
$result = Client::getAll();
$this->assertEquals([], $result);
}
示例6: test_deleteAll
function test_deleteAll()
{
//Arrange
$name = "Barbra Stylist";
$id = null;
$test_stylist = new Stylist($name, $id);
$test_stylist->save();
$name = "George";
$id = null;
$stylist_id = $test_stylist->getId();
$test_Client = new Client($name, $stylist_id, $id, $visits, $description);
$test_Client->save();
$name2 = "Max";
$id2 = null;
$stylist_id2 = $test_stylist->getId();
$visits2 = 3;
$test_Client2 = new Client($name2, $stylist_id2, $id2, $visits2, $description);
$test_Client2->save();
//Act
Client::deleteAll();
//Assert
$result = Client::getAll();
$this->assertEquals([], $result);
}
示例7: test_deleteAll
function test_deleteAll()
{
//Arrange
$name = "Stylist1";
$id = null;
$test_stylist = new Stylist($name, $id);
$test_stylist->save();
$name = "Client1";
$stylist_id = $test_stylist->getId();
$test_client = new Client($name, $id, $stylist_id);
$test_client->save();
$name = "Client2";
$test_client2 = new Client($name, $id, $stylist_id);
$test_client2->save();
//Act
Client::deleteAll();
$result = Client::getAll();
//Assert
$this->assertEquals([], $result);
}
示例8: test_deleteAll
function test_deleteAll()
{
//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();
$name2 = "Jordy Duran";
$phone2 = "239-094-0281";
$style_choice2 = "Bowl Cut";
$test_client2 = new Client($name2, $phone2, $style_choice2, $stylist_id);
$test_client2->save();
//Act
Client::deleteAll();
//Assert
$result = Client::getAll();
$this->assertEquals([], $result);
}
示例9: testDeleteAll
function testDeleteAll()
{
$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();
Client::deleteAll();
$result = Client::getAll();
$this->assertEquals([], $result);
}
示例10: test_deleteAll
function test_deleteAll()
{
$name = "Jane Doe";
$test_stylist = new Stylist($name);
$test_stylist->save();
$client_name = "Jimmy";
$client_stylist_id = $test_stylist->getId();
$test_client = new Client($client_name, $client_stylist_id);
$test_client->save();
$client_name2 = "Coco";
$test_client2 = new Client($client_name, $client_stylist_id);
$test_client2->save();
Client::deleteAll();
$result = Client::getAll();
$this->assertEquals([], $result);
}
示例11: test_deleteAll
function test_deleteAll()
{
//Arrange
$stylist = new Stylist("Diane", "5035528959", "MPB", false);
$stylist->save();
$client1 = new Client("Steven", "5412232442", $stylist->getId());
$client1->save();
$client2 = new Client("Matthew", "5097869876", $stylist->getId());
$client2->save();
//Act
Client::deleteAll();
$result = Client::getAll();
//Assert
$this->assertEquals([], $result);
}
示例12: test_deleteAll
function test_deleteAll()
{
$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();
$client_name2 = "Katie";
$stylist_id = $test_stylist->getId();
$test_client2 = new Client($id, $client_name, $stylist_id);
$test_client2->save();
Client::deleteAll();
$result = Client::getAll();
$this->assertEquals([], $result);
}
示例13: test_deleteAll
function test_deleteAll()
{
$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();
$name2 = "Steve";
$phone2 = "999-777-6666";
$stylist_id2 = $test_stylist->getId();
$test_client2 = new Client($name2, $phone2, $id, $stylist_id2);
$test_client2->save();
Client::deleteAll();
$result = Client::getAll();
$this->assertEquals([], $result);
}
示例14: actionDelete
public function actionDelete($id)
{
$orderModel = $this->loadModel($id);
$cid = $orderModel->cid;//联系人ID
if($orderModel->delete()){
Yii::app()->user->setFlash('success','删除成功!');
//删除房间信息
$roomModel = new OrderRoom;
$roomModel->deleteAll(array(
'condition'=>"oid=$id",
));
//删除保险
$insuranceModel = OrderInsurance::model()->find(array('condition'=>"oid=$id"));
if($insuranceModel){
$insuranceModel->delete();
}
//删除附加项(门票)
$addsModel = new OrderAdditional;
$addsModel->deleteAll(array('condition'=>"oid=$id"));
//删除联系人
$contacterModel = Contacter::model()->find(array('condition'=>"id=$cid and mid=0"));
if($contacterModel){
$contacterModel->delete();
}
//删除参团人信息
$clientModel = new Client;
$clientModel->deleteAll(array('condition'=>"oid=$id"));
}else{
Yii::app()->user->setFlash('error','删除失败!');
}
$this->redirect(array('list'));
exit;
/* // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
if(!isset($_GET['ajax']))
$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('list')); */
}
示例15: test_deleteAll
function test_deleteAll()
{
//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);
$client_name2 = "Ludacris";
$stylist_id = $test_stylist->getId();
$test_client2 = new Client($client_name2, $id, $stylist_id);
//act
Client::deleteAll();
//assert
$result = Client::getAll();
$this->assertEquals([], $result);
}