本文整理汇总了PHP中Client::findFirst方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::findFirst方法的具体用法?PHP Client::findFirst怎么用?PHP Client::findFirst使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client
的用法示例。
在下文中一共展示了Client::findFirst方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clientAction
public function clientAction($index)
{
$client = Client::findFirst($index);
$this->view->setVars(array("model" => "Clients", "client" => $client));
$this->view->setRenderLevel(View::LEVEL_ACTION_VIEW);
$this->view->pick("Accueil/client");
}
示例2: clientsAction
public function clientsAction($index = null)
{
$this->view->setRenderLevel(View::LEVEL_ACTION_VIEW);
if (!isset($index) || !is_numeric($index)) {
$clients = Client::find();
$this->view->setVars(array("model" => "Clients", "objects" => $clients));
$this->jquery->getOnClick(".edit", "Accueil/clients/", "#ajax-content");
} else {
$client = Client::findFirst($index);
$this->view->setVars(array("model" => "Clients", "client" => $client));
$this->view->pick("Accueil/client");
}
}
示例3: removeAction
public function removeAction($idClient)
{
$client = Client::findFirst(array('conditions' => 'idClient = ?1 AND idAccount = ?2', 'bind' => array(1 => $idClient, 2 => $this->user->idAccount)));
if (!$client) {
$this->flashSession->error("No se encontró el cliente, por favor valide la información");
return $this->response->redirect('client');
}
try {
$client->delete();
$this->flashSession->warning("Se ha eliminado el cliente exitosamente");
// return $this->response->redirect('client');
} catch (Exception $ex) {
$this->logger->log("Exception: {$ex}");
$this->flashSession->error("Ocurrió un error al eliminar este registro de cliente, es posible que esté asociado a una visita, por favor contacte al administrador");
// return $this->response->redirect('client');
}
return $this->response->redirect('client');
}
示例4: jsonAction
public function jsonAction($index)
{
$this->view->disable();
$client = Client::findFirst($index);
print_r(json_encode($client->toArray(), JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE));
}
示例5: clientAction
public function clientAction($idClient)
{
$client = Client::findFirst($idClient);
echo $client->toString();
$this->view->disable();
}