本文整理汇总了PHP中model::getKey方法的典型用法代码示例。如果您正苦于以下问题:PHP model::getKey方法的具体用法?PHP model::getKey怎么用?PHP model::getKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model
的用法示例。
在下文中一共展示了model::getKey方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: auth_get_class
function auth_get_class()
{
if (function_exists('getUser')) {
$id = model::searchKey('username', getUser());
return model::getKey($id[0], 'class');
} else {
return "guest";
}
}
示例2: rlinks
/**
* Get the reverse links of a node
* @param {Integer} $id node id
* @return {array} links
*/
static function rlinks($id)
{
$array = array();
// PROTOTYPE BEGIN
$protoname = model::getKey($id, 'prototype');
if ($protoname) {
$proto = model::searchKey('id', $protoname);
$proto = $proto[0];
if ($proto) {
$array = model::rlinks($proto);
}
}
// PROTOTYPE END
$query = "SELECT link.id AS link_id, link.src_id, node.* FROM link LEFT JOIN node ON node.id=link.src_id WHERE tgt_id='{$id}' ORDER BY type;";
if (!($result = mysql_query($query))) {
return $array;
}
if (!mysql_num_rows($result)) {
return $array;
}
while ($row = mysql_fetch_array($result)) {
$res = array("link_id" => $row["link_id"], "id" => $row["src_id"], "type" => $row["src_id"] == "0" ? "folder" : $row["type"]);
$array[] = $res;
}
return $array;
}
示例3: getbackupname
/**
*
*/
static function getbackupname($id)
{
$opath = model::getKey($id, 'file');
$pinfo = pathinfo($opath);
$filename = substr(basename($opath), 0, strpos(basename($opath), '.'));
$version = model::getKey($id, 'version') ? model::getKey($id, 'version') : "0";
return $filename . "-" . $version . "." . $pinfo['extension'];
}
示例4: json_encode
if (!assets::asset_upload(arg("id"), $path, arg("message"))) {
//
// HTTP errors don't work with ajaxupload - we send error 200 then a response != true
//header("HTTP/1.1: 304 Not Modified Asset Not updated");
//
echo json_encode('The file upload failed, the asset was not updated');
exit;
}
model::setKey(arg('id'), 'bytes', $_FILES['file']['size']);
//
// The result must be true for ajaxupload.js
//
echo json_encode(true);
break;
case "version_backup":
$path = model::getKey(arg('id'), 'file');
if (!file_exists($assetsLCL . $path)) {
header("HTTP/1.1: 404 Not Found");
echo "File " . $path . " not found";
exit;
}
if (!is_readable($assetsLCL . $path)) {
header("HTTP/1.1: 403 Forbidden");
echo "The file is not readable";
exit;
}
$id = assets::version_backup(arg("id"));
if (!$id) {
header('HTTP/1.1: 304 Not Modified Error on create');
exit;
}