本文整理汇总了PHP中Status::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Status::delete方法的具体用法?PHP Status::delete怎么用?PHP Status::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Status
的用法示例。
在下文中一共展示了Status::delete方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: remove
/**
* @userCache
*
* @param int $userId ユーザID
* @param int $statusId ステータスID
*
* @return Logics_Result
*/
public function remove($userId, $statusId)
{
$result = new Logics_Result();
$aStatus = new Status($statusId);
if ($aStatus->isSelected() && $aStatus->user_id === $userId) {
$aStatus->delete();
} else {
$result->failure();
}
return $result;
}
示例2: deleteStatus
function deleteStatus($id)
{
if (is_null($id)) {
Functions::setResponse(400);
}
try {
$s = new Status($id);
$s->delete();
return true;
} catch (RuntimeException $e) {
Functions::setResponse(404);
}
}
示例3: catch
Flight::ok($object);
} catch (Exception $exception) {
Flight::error($exception);
}
});
Flight::route('PUT /v1/main/status/@id', function ($id) {
try {
$object = Status::update($id);
Flight::ok($object);
} catch (Exception $exception) {
Flight::error($exception);
}
});
Flight::route('DELETE /v1/main/status/@id', function ($id) {
try {
$object = Status::delete($id);
Flight::ok($object);
} catch (Exception $exception) {
Flight::error($exception);
}
});
//=============================================================================
//Unit
//=============================================================================
Flight::route('GET /v1/main/unit', function () {
$company = Flight::request()->query->company;
try {
if ($company) {
$array = Unit::selectByCompany($company);
} else {
$array = Unit::selectAll();
示例4: delete
public function delete($f3, $params)
{
$obj = new Status($this->db);
echo json_encode($obj->delete($params["StatusID"]));
}
示例5: destroy
/**
* @transaction
*
* @param int $userId ユーザID
*
* @return Logics_Result
*/
public function destroy($userId)
{
$result = new Logics_Result();
$aUser = new User($userId);
if ($aUser->isSelected()) {
$or = new Sabel_Db_Condition_Or();
$or->add(C::create(C::EQUAL, "user_id", $aUser->id));
$or->add(C::create(C::EQUAL, "request_id", $aUser->id));
$request = new Request();
$request->delete($or);
$or = new Sabel_Db_Condition_Or();
$or->add(C::create(C::EQUAL, "user_id", $aUser->id));
$or->add(C::create(C::EQUAL, "follow_id", $aUser->id));
$follower = new Follower();
$follower->delete($or);
$status = new Status();
$status->delete("user_id", $userId);
$aUser->save(array("delete_flag" => true));
}
return $result;
}