本文整理汇总了PHP中DBServer::IsExists方法的典型用法代码示例。如果您正苦于以下问题:PHP DBServer::IsExists方法的具体用法?PHP DBServer::IsExists怎么用?PHP DBServer::IsExists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBServer
的用法示例。
在下文中一共展示了DBServer::IsExists方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: xListTasksAction
public function xListTasksAction()
{
$this->request->defineParams(array('bundleTaskId' => array('type' => 'int'), 'sort' => array('type' => 'json', 'default' => array('property' => 'id', 'direction' => 'DESC'))));
$sql = "SELECT * FROM bundle_tasks WHERE env_id = ?";
$args = array($this->getEnvironmentId());
if ($this->getParam('id') > 0) {
$sql .= " AND id = ?";
$args[] = $this->getParam('bundleTaskId');
}
$response = $this->buildResponseFromSql2($sql, array('id', 'server_id', 'rolename', 'status', 'os_family', 'dtadded', 'dtstarted', 'created_by_email'), array(), $args);
foreach ($response["data"] as &$row) {
$row['server_exists'] = DBServer::IsExists($row['server_id']);
$row['dtadded'] = Scalr_Util_DateTime::convertTz($row['dtadded']);
if (!$row['bundle_type']) {
$row['bundle_type'] = "*";
}
if ($row['dtfinished'] && $row['dtstarted']) {
$row['duration'] = Scalr_Util_DateTime::getDateTimeDiff($row['dtfinished'], $row['dtstarted']);
}
if ($row['dtfinished']) {
$row['dtfinished'] = Scalr_Util_DateTime::convertTz($row['dtfinished']);
}
if ($row['dtstarted']) {
$row['dtstarted'] = Scalr_Util_DateTime::convertTz($row['dtstarted']);
}
}
$this->response->data($response);
}
示例2: xListTasksAction
public function xListTasksAction()
{
$this->request->defineParams(array('bundleTaskId' => array('type' => 'int'), 'sort' => array('type' => 'string', 'default' => 'id'), 'dir' => array('type' => 'string', 'default' => 'DESC')));
$sql = "SELECT * FROM bundle_tasks WHERE env_id = '" . $this->getEnvironmentId() . "'";
if ($this->getParam('id') > 0) {
$sql .= " AND id = " . $this->db->qstr($this->getParam('bundleTaskId'));
}
$response = $this->buildResponseFromSql($sql, array("server_id", "rolename", "failure_reason", "snapshot_id", "id"));
foreach ($response["data"] as &$row) {
$row['server_exists'] = DBServer::IsExists($row['server_id']);
$row['dtadded'] = Scalr_Util_DateTime::convertTz($row['dtadded']);
if (!$row['bundle_type']) {
$row['bundle_type'] = "*";
}
if ($row['dtfinished'] && $row['dtstarted']) {
$row['duration'] = Scalr_Util_DateTime::getDateTimeDiff($row['dtfinished'], $row['dtstarted']);
}
if ($row['dtfinished']) {
$row['dtfinished'] = Scalr_Util_DateTime::convertTz($row['dtfinished']);
}
if ($row['dtstarted']) {
$row['dtstarted'] = Scalr_Util_DateTime::convertTz($row['dtstarted']);
}
}
$this->response->data($response);
}