本文整理汇总了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");
}