當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。