当前位置: 首页>>代码示例>>PHP>>正文


PHP ProjectRepository::delete方法代码示例

本文整理汇总了PHP中CodeProject\Repositories\ProjectRepository::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP ProjectRepository::delete方法的具体用法?PHP ProjectRepository::delete怎么用?PHP ProjectRepository::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CodeProject\Repositories\ProjectRepository的用法示例。


在下文中一共展示了ProjectRepository::delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     if ($this->checkProjectOwner($id) == false) {
         return ['msg' => 'Forbidden'];
     }
     $this->repository->delete($id);
 }
开发者ID:tiagocardosos,项目名称:laravel-codeeducation,代码行数:13,代码来源:ProjectController.php

示例2: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     if ($this->checkProjectPermissions($id) == false) {
         return ['error' => 'Acesso Negado'];
     }
     $this->repository->delete($id);
 }
开发者ID:danillosrangel,项目名称:CodeProject-curso,代码行数:13,代码来源:ProjectController.php

示例3: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     if ($this->checkProjectOwner($id) == false) {
         return ['error' => 'Access Forbiden'];
     }
     return $this->repository->delete($id);
 }
开发者ID:eduovrp,项目名称:laravel-com-angularjs,代码行数:13,代码来源:ProjectController.php

示例4: delete

 public function delete($id)
 {
     try {
         $this->repository->delete($id);
     } catch (ModelNotFoundException $e) {
         return response()->json(['error' => true, 'message' => "Project id {$id} not found"]);
     }
 }
开发者ID:brunowerneck,项目名称:codeproject-curso,代码行数:8,代码来源:ProjectService.php

示例5: destroy

 public function destroy($id)
 {
     try {
         return $this->repository->delete($id);
     } catch (ModelNotFoundException $e) {
         return ['error' => true, 'message' => 'Projeto não encontrado'];
     }
 }
开发者ID:poyastro,项目名称:codeproject-curso,代码行数:8,代码来源:ProjectService.php

示例6: delete

 public function delete($id)
 {
     $response = $this->repository->delete($id);
     if ($response === true) {
         return ['success' => true];
     }
     return $response;
 }
开发者ID:nativadesenvolvimento,项目名称:codeproject_curso,代码行数:8,代码来源:ProjectService.php

示例7: delete

 public function delete($id)
 {
     try {
         $this->repository->delete($id);
         return ['message' => 'Delete project success'];
     } catch (\PDOException $e) {
         return ['error' => true, 'message' => $e->getMessage()];
     } catch (ModelNotFoundException $e) {
         return ['error' => true, 'message' => $e->getMessage()];
     }
 }
开发者ID:sobreirami,项目名称:Codeproject,代码行数:11,代码来源:ProjectService.php

示例8: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     try {
         $this->repository->delete($id);
         return ['status' => 'success', 'message' => 'Project removed'];
     } catch (ModelNotFoundException $e) {
         return ['error' => true, 'message' => 'Project not Found'];
     } catch (QueryException $e) {
         return ['error' => true, 'message' => 'This project has related project notes'];
     }
 }
开发者ID:adanfm,项目名称:code-project,代码行数:17,代码来源:ProjectController.php

示例9: destroy

 /**
  * @param $projectId
  * @return array
  */
 public function destroy($projectId)
 {
     try {
         if ($this->repository->delete($projectId)) {
             return ['success' => true, 'message' => 'Registro excluído'];
         }
         return ['error' => true, 'message' => 'Erro desconhecido ao tentar excluir o registro'];
     } catch (\Exception $e) {
         return ["error" => true, "message" => $e->getMessage()];
     }
 }
开发者ID:adrianodrix,项目名称:codeproject.dev,代码行数:15,代码来源:ProjectService.php

示例10: delete

 public function delete($id)
 {
     $projects = $this->projectRepository->findByField('client_id', $id);
     foreach ($projects as $project) {
         $this->projectRepository->delete($project->id);
     }
     $response = $this->repository->delete($id);
     if ($response === true) {
         return ['success' => true];
     }
     return $response;
 }
开发者ID:nativadesenvolvimento,项目名称:codeproject_curso,代码行数:12,代码来源:ClientService.php

示例11: destroy

 public function destroy($id)
 {
     if (count(self::show($id)) == 0) {
         return ['error' => true, 'message' => 'Nao encontrado'];
     } else {
         if (count($this->repository->with(['project'])->findWhere(['id' => $id])) > 0) {
             return ['error' => true, 'message' => 'Este Cliente tem Projetos'];
         } else {
             return $this->repository->delete($id);
         }
     }
 }
开发者ID:mpiacentinis,项目名称:codeproject,代码行数:12,代码来源:ProjectController.php

示例12: delete

 public function delete($id)
 {
     try {
         $this->repository->delete($id);
         return ['success' => true, "message" => 'Registro excluído com sucesso.'];
     } catch (ModelNotFoundException $e) {
         return ['error' => true, 'message' => 'Registro não encontrado.', "messageDev" => $e->getMessage()];
     } catch (QueryException $e) {
         return ['error' => true, 'message' => 'Este registro não pode ser excluído, pois existe um ou mais projetos vinculados a ele.', "messageDev" => $e->getMessage()];
     } catch (\Exception $e) {
         return ["error" => true, "message" => 'Falha ao excluir registro.', "messageDev" => $e->getMessage()];
     }
 }
开发者ID:jonasleitep4,项目名称:curso-laravel-angular,代码行数:13,代码来源:ProjectService.php

示例13: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return Response
  */
 public function destroy($id)
 {
     if ($this->service->checkProjectPermissions($id) == false) {
         return ['error' => 'Access Forbidden'];
     }
     //$this->repository->find($id)->delete();
     $this->repository->delete($id);
 }
开发者ID:BrunoLagoa,项目名称:laravel_codeproject,代码行数:14,代码来源:ProjectController.php

示例14: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return Response
  */
 public function destroy($id)
 {
     if ($this->checkProjectOwner($id) == false) {
         return ['error' => 'Access forbidden'];
     }
     return ['success' => $this->repository->delete($id)];
     //['success' => Client::find($id)->delete()];
 }
开发者ID:notridan,项目名称:codeproject,代码行数:14,代码来源:ProjectController.php

示例15: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     if ($this->checkProjectPermissions($id) == false) {
         return ['error' => 'Access Forbidden'];
     }
     if ($this->repository->delete($id)) {
         return ['success' => true];
     }
 }
开发者ID:edujrsilva84,项目名称:CodeProject,代码行数:15,代码来源:ProjectFileController.php


注:本文中的CodeProject\Repositories\ProjectRepository::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。