當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ProjectRepository::with方法代碼示例

本文整理匯總了PHP中CodeProject\Repositories\ProjectRepository::with方法的典型用法代碼示例。如果您正苦於以下問題:PHP ProjectRepository::with方法的具體用法?PHP ProjectRepository::with怎麽用?PHP ProjectRepository::with使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CodeProject\Repositories\ProjectRepository的用法示例。


在下文中一共展示了ProjectRepository::with方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: find

 public function find($id)
 {
     if (is_null(Project::find($id))) {
         return Errors::invalidId($id);
     }
     return $this->repository->with(['client', 'owner'])->find($id);
 }
開發者ID:nelioalves,項目名稱:teste-team,代碼行數:7,代碼來源:ProjectService.php

示例2: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     if ($this->checkProjectPermissions($id) == false) {
         return "Access Forbidden";
     }
     return $this->repository->with('client')->with('user')->findOrFail($id);
 }
開發者ID:Gabriel-aa,項目名稱:curso-laravel,代碼行數:13,代碼來源:ProjectController.php

示例3: show

 /**
  * Display the specified resource.
  *
  * @param  int $id
  * @return Response
  */
 public function show($id)
 {
     //        if ($this->checkProjectOwner($id)==false){
     //            return ['error' => 'Access forbidden'];
     //        }
     return $this->repository->with(['owner', 'client'])->find($id);
 }
開發者ID:notridan,項目名稱:codeproject,代碼行數:13,代碼來源:ProjectController.php

示例4: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     if ($this->checkProjectPermissions($id) == false) {
         return ['msg' => 'Forbidden'];
     }
     return $this->repository->with(['owner', 'notes', 'client', 'members'])->find($id);
 }
開發者ID:tiagocardosos,項目名稱:laravel-codeeducation,代碼行數:13,代碼來源:ProjectFileController.php

示例5: listMembers

 public function listMembers($id_project)
 {
     try {
         return $this->repository->with(['members'])->find($id_project);
     } catch (ModelNotFoundException $e) {
         return ['error' => true, 'message' => 'Projeto não existe'];
     }
 }
開發者ID:phelippe,項目名稱:CodeProject,代碼行數:8,代碼來源:ProjectService.php

示例6: getProject

 public function getProject($id = "")
 {
     if ($id) {
         return $this->repository->with(['owner', 'client'])->find($id);
     } else {
         return $this->repository->with(['owner', 'client'])->all();
     }
 }
開發者ID:paulohsilvestre,項目名稱:CodeProject,代碼行數:8,代碼來源:ProjectServices.php

示例7: show

 public function show($id)
 {
     try {
         return ["success" => $this->repository->with(['owner', 'client'])->find($id)];
     } catch (ModelNotFoundException $e) {
         return ["success" => false, "message" => "Projeto ID: {$id} inexistente!"];
     }
 }
開發者ID:Julianocs,項目名稱:codeproject_curso,代碼行數:8,代碼來源:ProjectService.php

示例8: show

 public function show($id)
 {
     try {
         return $this->repository->with(['owner', 'client', 'notes', 'tasks', 'members'])->find($id);
     } catch (ModelNotFoundException $e) {
         return ['error' => true, 'message' => $e->getMessage()];
     }
 }
開發者ID:sobreirami,項目名稱:Codeproject,代碼行數:8,代碼來源:ProjectService.php

示例9: read

 public function read($id)
 {
     try {
         return response()->json($this->repository->with(['owner', 'client'])->find($id));
     } catch (ModelNotFoundException $ex) {
         return response()->json(['error' => true, 'message' => "Project id {$id} not found"]);
     }
 }
開發者ID:brunowerneck,項目名稱:codeproject-curso,代碼行數:8,代碼來源:ProjectService.php

示例10: find

 public function find($id)
 {
     try {
         $this->setPresenter();
         return $this->repository->with(['owner', 'client'])->find($id);
     } catch (\Exception $e) {
         return ['error' => true, 'message' => $e->getMessage()];
     }
 }
開發者ID:netoudi,項目名稱:laravel-angularjs,代碼行數:9,代碼來源:ProjectService.php

示例11: show

 /**
  * Display the specified resource.
  *
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     try {
         return $this->repository->with(['owner', 'client'])->find($id);
     } catch (ModelNotFoundException $e) {
         return $this->erroMsgm('Projeto não encontrado.');
     } catch (\Exception $e) {
         return $this->erroMsgm('Ocorreu um erro ao exibir o projeto.');
     }
 }
開發者ID:maiconmarioto,項目名稱:CodeProject,代碼行數:16,代碼來源:ProjectOldController.php

示例12: find

 /**
  * @param $id
  * @return array|mixed
  */
 public function find($id)
 {
     try {
         return $this->repository->with(['client', 'owner', 'notes'])->find($id);
     } catch (\Exception $e) {
         if (get_class($e) == 'Illuminate\\Database\\Eloquent\\ModelNotFoundException') {
             return ['error' => true, 'message' => 'Project does not exist' + $message];
         }
     }
 }
開發者ID:hugosv,項目名稱:codeproject-curso,代碼行數:14,代碼來源:ProjectService.php

示例13: show

 public function show($id)
 {
     try {
         // return $this->repository->find($id);
         // return $this->repository->with(['owner', 'client'])->find($id);
         return $this->repository->with(['owner', 'client'])->find($id);
     } catch (Exception $e) {
         return ['error' => true, 'message' => $e->getMessage()];
     }
 }
開發者ID:BrunoDamiao,項目名稱:Laravel-5.1,代碼行數:10,代碼來源:ProjectService.php

示例14: removeMember

 public function removeMember($id, $memberId)
 {
     try {
         //$user->roles()->detach($roleId);
         //$this->repository->find($id)->members()->detach($memberId);
         $this->repository->with(['members'])->find($id)->detach($memberId);
         return response()->json(['error' => false, 'message' => ['removeMember' => "Member ID {$memberId} removed"]]);
     } catch (ModelNotFoundException $ex) {
         return ['error' => true, 'message' => 'ID not found'];
     }
 }
開發者ID:robinhodemorais,項目名稱:laravel_codeproject,代碼行數:11,代碼來源:ProjectService.php

示例15: 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


注:本文中的CodeProject\Repositories\ProjectRepository::with方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。