本文整理汇总了PHP中Connect::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Connect::update方法的具体用法?PHP Connect::update怎么用?PHP Connect::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Connect
的用法示例。
在下文中一共展示了Connect::update方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveHistory
function saveHistory()
{
$data = ['content' => $_POST['content']];
$result = Connect::update("text", $data, " WHERE key_t='history' ");
if ($result) {
echo json_encode(['status' => true]);
} else {
echo json_encode(['status' => false]);
}
exit(0);
}
示例2: setStatus
public function setStatus($message, $status = NULL)
{
$id = is_array($message) && $message['id'] ? $message['id'] : $message;
if (isset($status) && $status) {
$mstatus = $status;
} elseif (is_array($message) && $message['status'] >= 0) {
$mstatus = $message['status'];
} else {
return;
}
$message = $this->connect->update($this->tableName, ['status' => $mstatus], 'id = ' . $id);
return $message;
}
示例3: shareFile
/**
* @param $fid
* @param $uid
* @param $wUid
* @return bool|string
* @throws \Exception
* @throws \OC\HintException
*/
public function shareFile($uid, $wUid, $fid, $permission = 1)
{
$isEnabled = \OCP\Share::isEnabled();
$isAllowed = \OCP\Share::isResharingAllowed();
$sharedWith = \OCP\Share::getUsersItemShared('file', $fid, $uid, false, true);
//$file = $this->connect->files()->getInfoById($fid);
if ($isEnabled && $isAllowed && !in_array($wUid, $sharedWith)) {
// \OCP\Constants::PERMISSION_READ
// \OCP\Constants::PERMISSION_ALL
// \OCP\Share::SHARE_TYPE_LINK
// \OCP\Share::SHARE_TYPE_USER,
$shareIsSuccess = \OC\Share\Share::shareItem('file', $fid, \OCP\Share::SHARE_TYPE_USER, $wUid, $permission);
if ($shareIsSuccess) {
$this->connect->update('*PREFIX*share', ['uid_initiator' => $uid], 'share_with = :share_with AND uid_owner = :uid_owner AND file_source = :file_source', [':share_with' => $wUid, ':uid_owner' => $uid, ':file_source' => $fid]);
$token = \OC\Share\Share::shareItem('file', $fid, \OCP\Share::SHARE_TYPE_LINK, $wUid, $permission);
$this->connect->update('*PREFIX*share', ['uid_initiator' => $uid, 'share_with' => null], 'uid_owner = :uid_owner AND file_source = :file_source AND token = :token', [':uid_owner' => $uid, ':file_source' => $fid, ':token' => $token]);
return $token;
}
}
}
示例4: updateTask
public function updateTask($id, $data)
{
return $this->connect->update($this->tableName, $data, 'id = ?', [(int) $id]);
}
示例5: update
public function update($data)
{
$this->connect->update($this->tableName, $data, 'id = ' . $data['id']);
}