本文整理匯總了PHP中backend\models\User::deleteAll方法的典型用法代碼示例。如果您正苦於以下問題:PHP User::deleteAll方法的具體用法?PHP User::deleteAll怎麽用?PHP User::deleteAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類backend\models\User
的用法示例。
在下文中一共展示了User::deleteAll方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: actionDelete
/**
* Delete a user
*
* <b>Request Type</b>: DELETE<br/><br/>
* <b>Request Endpoint</b>:http://{server-domain}/management/user<br/><br/>
* <b>Content-type</b>: application/json<br/><br/>
* <b>Summary</b>: This api is used for billing account to delete a user
* <br/><br/>
*
* <b>Request Params</b>:<br/>
* id: string, the user id, required<br/>
* <br/><br/>
*
* <b>Response Params:</b><br/>
* ack: integer, mark the create result, 0 means create successfully, 1 means create fail<br/>
* data: array, json array to return true<br/>
* <br/><br/>
*
* <b>Request Example:</b><br/>
* <pre>
* {
* "id" : "547f01dd2c5711421c8b457c",
* }
* </pre>
* <br/><br/>
*
* <b>Response Example</b>:<br/>
* <pre>
* {
* 'ack' : 1,
* 'data': {"id": "547f01dd2c5711421c8b457c"}
* }
* </pre>
*/
public function actionDelete()
{
$params = $this->getParams();
if (User::deleteAll(['_id' => $params['id']])) {
return $params['id'];
}
throw new ServerErrorHttpException("delete user fail");
}