本文整理汇总了PHP中ORM::id方法的典型用法代码示例。如果您正苦于以下问题:PHP ORM::id方法的具体用法?PHP ORM::id怎么用?PHP ORM::id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ORM
的用法示例。
在下文中一共展示了ORM::id方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: id
/**
* Get the database ID of this model instance.
*
* @return integer
*/
public function id()
{
return $this->orm->id();
}
示例2: array
if (!$launch) {
return false;
}
$launchkeys = array("course_id" => $crs->id(), "user_id" => $usr->id());
if ($org && $org->id()) {
$launchkeys[org_id] = $org->id();
} else {
// Make sure to never get a org with a primary key of -1
$launchkeys[org_id] = -1;
}
$launch->read($launchkeys);
$launch->setall($launchkeys);
// Set the foreign keys
$launch->setall($_REQUEST, '/^launch_/');
$launchpassword = md5(uniqid(rand(), true));
if ($launch->id()) {
$launch->update();
DPRT("Updated launch={$launch->id}()");
} else {
$launch->insert();
DPRT("Added launch={$launch->id}()");
}
// Log this digest
$reqstr = mysql_real_escape_string(print_r($_REQUEST, TRUE));
$quer = "insert into lti_digest (created_at, digest, request) values (NOW(), '{$digest}', '{$reqstr}');";
mysql_query($quer);
// Time to return a response, we either return a web service
// response, debug outtput, or redirect back to ourselves
$theurl = $_SERVER[SCRIPT_URI];
$theuri = $_SERVER[REQUEST_URI];
$i = strpos($theuri, '?');
示例3: unset
if ($_REQUEST[lti_launch_id]) {
$launchid = $_REQUEST[lti_launch_id];
} else {
if (!empty($_SESSION['lti_launch_id'])) {
$launchid = $_SESSION[lti_launch_id];
} else {
unset($_SESSION['lti_launch_id']);
redirect_login();
$launchid = false;
}
}
if ($launchid) {
$launch = new ORM("launch", false, "lti_launch");
if (!$launch) {
throw new Exception("LTI Runtime - Datebase unable to instance user");
}
$launch->get($launchid);
if (!$launch->id()) {
throw new Exception("LTI Runtime - Launch session not found");
}
$launchdata = $launch->data();
$_SESSION['lti_launch_id'] = $launch->id();
if ($launch && $launch->data()) {
$LTI = new LTIObject($launch->data());
}
}
} catch (Exception $e) {
DPRT($e->getMessage());
redirect_login();
$LTI = false;
}