本文整理汇总了PHP中Client::setId方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::setId方法的具体用法?PHP Client::setId怎么用?PHP Client::setId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client
的用法示例。
在下文中一共展示了Client::setId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSetGet
public function testSetGet()
{
$client = new Client();
$id = 'test_id';
$client->setId($id);
$this->assertEquals($id, $client->getId(), 'Unable to setup id!');
$name = 'test_name';
$client->setName($name);
$this->assertEquals($name, $client->getName(), 'Unable to setup name!');
$title = 'test_title';
$client->setTitle($title);
$this->assertEquals($title, $client->getTitle(), 'Unable to setup title!');
$userAttributes = ['attribute1' => 'value1', 'attribute2' => 'value2'];
$client->setUserAttributes($userAttributes);
$this->assertEquals($userAttributes, $client->getUserAttributes(), 'Unable to setup user attributes!');
$normalizeUserAttributeMap = ['name' => 'some/name', 'email' => 'some/email'];
$client->setNormalizeUserAttributeMap($normalizeUserAttributeMap);
$this->assertEquals($normalizeUserAttributeMap, $client->getNormalizeUserAttributeMap(), 'Unable to setup normalize user attribute map!');
$viewOptions = ['option1' => 'value1', 'option2' => 'value2'];
$client->setViewOptions($viewOptions);
$this->assertEquals($viewOptions, $client->getViewOptions(), 'Unable to setup view options!');
}
示例2: createClients10
public function createClients10()
{
$client10 = new Client();
$client10->setId('10');
$client10->setNome('NELSON MANDELA');
$client10->setTelefone('1010-1010');
$client10->setEndereco('RUA DO CLIENTE 10');
$client10->setEmail('cliente10@teste.com.br');
$client10->setCpf('999.999.999-10');
$client10->setTipo('PF');
return $client10;
}
示例3: findClientOrder
function findClientOrder($projectID, $projectView = false)
{
$result = $this->database->query($this->buildClientOrderQuery($projectID, $projectView));
if (!is_null($result->getError())) {
return $result->getError();
}
$clients = array();
while ($row = $result->fetchRow()) {
$client = new Client();
$value = $row[0];
$client->setId($value);
array_push($clients, $client);
}
return $clients;
}
示例4: actionSaveClient
function actionSaveClient($currentProject)
{
$backUrl = $this->context->getFlowScopeAttr("backUrl");
$projectID = $this->context->getRequestAttr("projectID");
$edit = $this->context->getRequestAttr("edit");
$client = new Client();
$clientErrs = array();
$client->setId($this->context->getRequestAttr("id"));
$client->setPid($this->context->getRequestAttr("projectID"));
$client->setName($this->context->getRequestAttr("name"));
if (!is_null($client->getName())) {
$client->setName(trim($client->getName()));
if (strlen($client->getName()) < 1) {
$client->setName(null);
}
}
if (is_null($client->getName())) {
$clientErrs["name"] = "field.error.empty";
}
$client->setEmail($this->context->getRequestAttr("email"));
if (!is_null($client->getEmail())) {
$client->setEmail(trim($client->getEmail()));
if (strlen($client->getEmail()) < 1) {
$client->setEmail(null);
}
}
if (is_null($client->getEmail())) {
$clientErrs["email"] = "field.error.empty";
}
$client->setTelephone($this->context->getRequestAttr("telephone"));
if (!is_null($client->getTelephone())) {
$client->setTelephone(trim($client->getTelephone()));
if (strlen($client->getTelephone()) < 1) {
$client->setTelephone(null);
}
}
$client->setCustomer($this->context->getRequestAttr("customer"));
if (!is_null($client->getCustomer())) {
$client->setCustomer(trim($client->getCustomer()));
if (strlen($client->getCustomer()) < 1) {
$client->setCustomer(null);
}
}
$client->setComment($this->context->getRequestAttr("comment"));
if (!is_null($client->getComment())) {
$client->setComment(trim($client->getComment()));
if (strlen($client->getComment()) < 1) {
$client->setComment(null);
}
}
$client->setPeriodical(false);
$client->setPeriodicalid(0);
$timeZone = new DateTimeZone("Europe/Vilnius");
$time = new DateTime("now", $timeZone);
$client->setR_date($time->format("Y-m-d H:i:s"));
$client->setR_user(777);
$client->setActive(true);
$this->context->setFlashScopeAttr("createClient", $client);
$this->context->setFlashScopeAttr("clientErrs", $clientErrs);
$this->context->setFlashScopeAttr("projectID", $projectID);
if (count($clientErrs) >= 1) {
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
}
$insert = true;
$store = $this->storeClient($client);
if (!$store) {
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
}
if ($insert && $edit == 0) {
$eventHistory = new EventHistory();
$eventHistory->setPid($client->getPid());
$eventHistory->setCid($client->getId());
$eventHistory->setR_date($client->getR_date());
$eventHistory->setDescription("Sukurtas partnerio");
$this->storeEventHistory($eventHistory);
}
$this->cancelClientCreate();
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
}
示例5: actionSaveClient
function actionSaveClient($currentUser)
{
$backUrl = $this->context->getFlowScopeAttr("backUrl");
$client = new Client();
$clientErrs = array();
$client->setId($this->context->getRequestAttr("id"));
$client->setPid($this->context->getRequestAttr("projectID"));
$client->setName($this->context->getRequestAttr("name"));
if (!is_null($client->getName())) {
$client->setName(trim($client->getName()));
if (strlen($client->getName()) < 1) {
$client->setName(null);
}
}
if (is_null($client->getName())) {
$clientErrs["name"] = "field.error.empty";
}
$client->setEmail($this->context->getRequestAttr("email"));
if (!is_null($client->getEmail())) {
$client->setEmail(trim($client->getEmail()));
if (strlen($client->getEmail()) < 1) {
$client->setEmail(null);
}
}
if (is_null($client->getEmail())) {
$clientErrs["email"] = "field.error.empty";
}
$client->setTelephone($this->context->getRequestAttr("telephone"));
if (!is_null($client->getTelephone())) {
$client->setTelephone(trim($client->getTelephone()));
if (strlen($client->getTelephone()) < 1) {
$client->setTelephone(null);
}
}
$client->setCustomer($this->context->getRequestAttr("customer"));
if (!is_null($client->getCustomer())) {
$client->setCustomer(trim($client->getCustomer()));
if (strlen($client->getCustomer()) < 1) {
$client->setCustomer(null);
}
}
$client->setComment($this->context->getRequestAttr("comment"));
if (!is_null($client->getComment())) {
$client->setComment(trim($client->getComment()));
if (strlen($client->getComment()) < 1) {
$client->setComment(null);
}
}
$periodicalID = $this->context->getRequestAttr("periodicalid");
$periodical = $this->context->getRequestAttr("periodCustomer");
$client->setPeriodical($periodical == 1 ? true : false);
$timeZone = new DateTimeZone("Europe/Vilnius");
$time = new DateTime("now", $timeZone);
$client->setR_date($time->format("Y-m-d H:i:s"));
$client->setR_user($currentUser->getId());
$client->setActive(true);
if (!is_null($periodicalID) && !$client->isPeriodical()) {
$this->clientPeriodicalDao->delete($periodicalID);
$this->clientDaol->resetPeriodicalClients($periodicalID);
$client->setPeriodicalid(0);
}
if ($client->isPeriodical()) {
$clientPeriodical = new ClientPeriodical();
$clientPeriodical->setId($periodicalID);
$clientPeriodical->setPid($client->getPid());
$clientPeriodical->setName($client->getName());
$clientPeriodical->setEmail($client->getEmail());
$clientPeriodical->setCustomer($client->getCustomer());
$clientPeriodical->setTelephone($client->getTelephone());
$clientPeriodical->setComment($client->getComment());
$clientPeriodical->setR_date($time->format("Y-m-d H:i:s"));
$clientPeriodical->setR_user($currentUser->getId());
$clientPeriodical->setPeriod_type($this->context->getRequestAttr("period_type"));
$clientPeriodical->setWeek_day($this->context->getRequestAttr("week_day"));
$clientPeriodical->setMonth_day($this->context->getRequestAttr("month_day"));
$clientPeriodical->setHour($this->context->getRequestAttr("hour"));
} else {
$clientPeriodical = new ClientPeriodical();
}
$this->context->setFlashScopeAttr("client", $client);
$this->context->setFlashScopeAttr("clientPeriodical", $clientPeriodical);
$this->context->setFlashScopeAttr("clientErrs", $clientErrs);
$projectID = $client->getPid();
if (!$this->setStoreProject($projectID, "clientProject")) {
$this->cancelClientEdit();
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
}
if (count($clientErrs) >= 1) {
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
}
$insert = false;
if (is_null($client->getId())) {
//.........这里部分代码省略.........