当前位置: 首页>>代码示例>>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;未经允许,请勿转载。