本文整理汇总了PHP中client::save方法的典型用法代码示例。如果您正苦于以下问题:PHP client::save方法的具体用法?PHP client::save怎么用?PHP client::save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类client
的用法示例。
在下文中一共展示了client::save方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
function save()
{
$rtn = parent::save();
$c = new client();
$c->set_id($this->get_value("clientID"));
$c->select();
$c->save();
return $rtn;
}
示例2: date
$clientID = $_POST["clientID"] or $clientID = $_GET["clientID"];
if ($_POST["save"]) {
if (!$_POST["clientName"]) {
alloc_error("Please enter a Client Name.");
}
$client->read_globals();
$client->set_value("clientModifiedTime", date("Y-m-d"));
$clientID = $client->get_id();
$client->set_values("client_");
if (!$client->get_id()) {
// New client.
$client->set_value("clientCreatedTime", date("Y-m-d"));
$new_client = true;
}
if (!$TPL["message"]) {
$client->save();
$clientID = $client->get_id();
$client->set_values("client_");
}
} else {
if ($_POST["save_attachment"]) {
move_attachment("client", $clientID);
alloc_redirect($TPL["url_alloc_client"] . "clientID=" . $clientID . "&sbs_link=attachments");
} else {
if ($_GET["get_vcard"]) {
$clientContact = new clientContact();
$clientContact->set_id($_GET["clientContactID"]);
$clientContact->select();
$clientContact->output_vcard();
return;
} else {
示例3: stylist
function test_deleteClient()
{
//Arrange
$name = "Tessa";
$id = null;
$test_stylist = new stylist($name, $id);
$test_stylist->save();
$test_stylist_id = $test_stylist->getId();
$name = "Mai";
$description = "Scary";
$visits = 3;
$name2 = "Doory";
$description2 = "Not worth it.";
$visits2 = 4;
$test_client = new client($name, $test_stylist_id, $id, $visits, $description);
$test_client2 = new client($name2, $test_stylist_id, $id, $visits2, $description2);
$test_client->save();
$test_client2->save();
//Act
$test_client->deleteClient();
//Assert
$this->assertEquals([$test_client2], client::getAll());
}
示例4: postCreateclient
public function postCreateclient()
{
$validator = Validator::make(Input::all(), ['client_name' => 'required', 'company_internal_name' => 'required', 'company_internal_code' => 'required', 'client_code' => 'required']);
if ($validator->fails()) {
//dd($validator);
return redirect('admin/orders')->withErrors($validator)->withInput();
} else {
//$date = date('Y-m-d H:i:s');
$client = new client();
$client->client_name = Input::get('client_name');
$client->company_internal_name = Input::get('company_internal_name');
$client->company_internal_code = Input::get('company_internal_code');
$client->client_code = Input::get('client_code');
$client->save();
return redirect('admin/orders')->with('new_client', 'New client profile created succesfully');
}
}
示例5: client
function test_updateName()
{
$client_name = "Rob";
$stylist_id = 1;
$test_client = new client($client_name, $stylist_id);
$test_client->save();
$new_client_name = "Dingo";
//Act
$test_client->updateName($new_client_name);
//Assert
$this->assertEquals($test_client->getclientName(), "Dingo");
}