本文整理汇总了PHP中Api::json方法的典型用法代码示例。如果您正苦于以下问题:PHP Api::json方法的具体用法?PHP Api::json怎么用?PHP Api::json使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Api
的用法示例。
在下文中一共展示了Api::json方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
public function delete($role)
{
if (in_array($role->name, \Role::$protected)) {
return Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
} else {
return $role->delete() ? Api::json(array('result' => 'success')) : Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
}
}
示例2: deleteIndex
public function deleteIndex($user, $profile)
{
$id = $profile->id;
if (!$profile->delete()) {
return Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
}
$profile = UserProfiles::find($id);
return empty($profile) ? Api::json(array('result' => 'success')) : Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
}
示例3: deleteIndex
/**
* Remove the specified resource from storage.
*
* @param $comment
* @return Response
*/
public function deleteIndex($comment)
{
$id = $comment->id;
if (!$comment->delete()) {
return Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
}
$comment = Comment::find($id);
return empty($comment) ? Api::json(array('result' => 'success')) : Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
}
示例4: delete
public function delete($user)
{
return $user->delete() ? Api::json(array('result' => 'success')) : Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
}
示例5: delete
public function delete($user, $profile)
{
return $this->user->deleteProfile($profile) ? Api::json(array('result' => 'success')) : Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
}
示例6: deleteIndex
/**
* Remove the specified user from storage.
*
* @param $user
* @return Response
*/
public function deleteIndex($user)
{
// Check if we are not trying to delete ourselves
if ($user->id === Confide::user()->id) {
// Redirect to the user management page
return Api::to(array('error', Lang::get('admin/users/messages.delete.impossible'))) ?: Redirect::to('admin/users')->with('error', Lang::get('admin/users/messages.delete.impossible'));
}
$id = $user->id;
Activity::log(array('contentID' => $user->id, 'contentType' => 'account_deleted', 'description' => $user->id, 'details' => '', 'updated' => Confide::user()->id ? true : false));
Event::fire('controller.user.delete', array($user));
if (!$user->delete()) {
return Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
}
$user = User::find($id);
return empty($user) ? Api::json(array('result' => 'success')) : Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
}
示例7: getStatus
public function getStatus($tickets, $status)
{
$tickets->status = $status;
return $tickets->save() ? Api::json(array('result' => 'success')) : Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
}
示例8: deleteIndex
/**
* Remove the specified resource from storage.
*
* @param $post
* @return Response
*/
public function deleteIndex($statuses)
{
$id = $statuses->id;
if (!$statuses->delete()) {
return Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
}
$statuses = TicketDeps::find($id);
return empty($statuses) ? Api::json(array('result' => 'success')) : Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
}
示例9: assign
public function assign($todo)
{
return $todo->assign() ? Api::json(array('result' => 'success')) : Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
}
示例10: postAssign
/**
* assign to current user
*
* @return Response
*/
public function postAssign($todo)
{
$todo->admin_id = Confide::user()->id;
return $todo->save() ? Api::json(array('result' => 'success')) : Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
}
示例11: deleteIndex
/**
* Remove the specified user from storage.
*
* @param $map
* @internal param $id
* @return Response
*/
public function deleteIndex($map)
{
$id = $map->id;
if (!$map->delete()) {
return Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
}
$maps = Map::find($id);
return empty($maps) ? Api::json(array('result' => 'success')) : Api::json(array('result' => 'error', 'error' => Lang::get('core.delete_error')));
}