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


PHP ProjectRepository::skipPresenter方法代码示例

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


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

示例1: createFile

 public function createFile(array $data)
 {
     $project = $this->repository->skipPresenter()->find($data['project_id']);
     $projectFile = $project->files()->create($data);
     $arquivo = $projectFile->id . "." . $data['extension'];
     \Storage::put($arquivo, \File::get($data['file']));
 }
开发者ID:danillosrangel,项目名称:CodeProject-curso,代码行数:7,代码来源:ProjectService.php

示例2: createFile

 public function createFile(array $data)
 {
     $project = $this->repository->skipPresenter()->find($data['project_id']);
     //dd($project);
     $projectFile = $project->files()->create($data);
     $this->storage->put($projectFile->id . "." . $data['extension'], $this->filesystem->get($data['file']));
 }
开发者ID:EltonSouza,项目名称:laravel-com-angular2,代码行数:7,代码来源:ProjectService.php

示例3: checkProjectPermissions

 private function checkProjectPermissions($projectId)
 {
     $this->repository->skipPresenter(true);
     if ($this->checkProjectOwner($projectId) or $this->checkProjectMember($projectId)) {
         $this->repository->skipPresenter(false);
         return true;
     }
     return false;
 }
开发者ID:90lucasgabriel,项目名称:activity,代码行数:9,代码来源:ProjectController.php

示例4: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $user_id = \Authorizer::getResourceOwnerId();
     $project_id = $request->project;
     $projects = $this->repository->skipPresenter()->findWhere(['id' => $project_id, 'owner_id' => $user_id]);
     if (count($projects) == false) {
         return ['error' => 'Access forbidden'];
     }
     return $next($request);
 }
开发者ID:phelippe,项目名称:CodeProject,代码行数:17,代码来源:CheckProjectOwner.php

示例5: create

 public function create(array $data)
 {
     try {
         $this->validator->with($data)->passesOrFail();
         $project = $this->projectRepository->skipPresenter()->find($data['project_id']);
         $projectTask = $project->tasks()->create($data);
         return $projectTask;
     } catch (ValidatorException $e) {
         return ['error' => true, 'message' => $e->getMessageBag()];
     }
 }
开发者ID:BrunoAlvesSantos,项目名称:codeproject-curso,代码行数:11,代码来源:ProjectTaskService.php

示例6: create

 /**
  * @param array $data
  *
  * @return array
  * @throws \Prettus\Validator\Exceptions\ValidatorException
  */
 public function create(array $data)
 {
     try {
         $this->validator->with($data)->passesOrFail(ValidatorInterface::RULE_CREATE);
         $project = $this->projectRepository->skipPresenter()->find($data['project_id']);
         $projectFile = $project->files()->create($data);
         $this->storage->put($projectFile->id . '.' . $data['extension'], $this->filesystem->get($data['file']));
         return $projectFile;
     } catch (ValidatorException $e) {
         return ['error' => true, 'message' => $e->getMessageBag()];
     }
 }
开发者ID:felipeminello,项目名称:laravel.angular,代码行数:18,代码来源:ProjectFileService.php

示例7: deleteFile

 public function deleteFile($project_id, $file_id)
 {
     $project = $this->repository->skipPresenter()->find($project_id);
     if ($project) {
         $projectFile = $project->files->find($file_id);
         if ($projectFile) {
             $this->storage->delete($projectFile->id . '.' . $projectFile->extension);
             $projectFile->delete($file_id);
         } else {
             return ['error' => true, 'message' => 'Arquivo não encontrado'];
         }
     }
 }
开发者ID:henriesteves,项目名称:CodeProject,代码行数:13,代码来源:ProjectService.php

示例8: create

 public function create(array $data)
 {
     try {
         $this->fileValidator->with($data)->passesOrFail();
         $project = $this->projectRepository->skipPresenter()->find($data['project_id']);
         $projectFile = $project->files()->create($data);
         $this->storage->put($projectFile->getFileName(), $this->fileSystem->get($data['file']));
         return ['error' => false, 'message' => 'Arquivo inserido com sucesso!'];
     } catch (ValidatorException $e) {
         $error = $e->getMessageBag();
         return ['error' => true, 'message' => "Erro ao enviar o arquivo, alguns campos são obrigatórios!", 'messages' => $error->getMessages()];
     }
 }
开发者ID:maiconmarioto,项目名称:CodeProject,代码行数:13,代码来源:ProjectFileService.php

示例9: deleteFile

 public function deleteFile($idProject, $idFile)
 {
     try {
         // $projectFile = $this->repository->skipPresenter()->with(['files'])->find($idFile);
         /*
          * Busco o File do project e acesso o files que está relacionando no Project buscando o file
          */
         $projectFile = $this->repository->skipPresenter()->find($idProject)->files()->find($idFile);
         //pega no nome do arquivo e extensão para deletar da pasta
         $nomeFile = $idFile . "." . $projectFile->extension;
         //deleta da pasta
         $this->filesystem->delete($nomeFile);
         //return response()->json(['error' => false,'message' => "ProjectFile {$idFile} deleted"]);
     } catch (ModelNotFoundException $ex) {
         return $this->notFound($idFile);
     }
     //deleta o file da tabela
     try {
         $this->repository->skipPresenter()->find($idProject)->files()->detach($idFile);
     } catch (ModelNotFoundException $e) {
         try {
             $this->repository->skipPresenter()->find($idProject)->files()->detach($idFile);
             return response()->json(['error' => false, 'message' => "ProjectFile {$idFile} deleted"]);
         } catch (ModelNotFoundException $e) {
             return response()->json(['error' => true, 'message' => "ProjectFile {$idFile} not found"]);
         }
     }
 }
开发者ID:robinhodemorais,项目名称:codeproject-curso,代码行数:28,代码来源:ProjectService.php

示例10: create

 public function create(array $data)
 {
     // diversos serviços
     // enviar email
     // disparar notificacao
     try {
         //dd($data);
         $this->validator->with($data)->passesOrFail(ValidatorInterface::RULE_CREATE);
         $project = $this->projectRepository->skipPresenter()->find($data['project_id']);
         $projectFile = $project->files()->create($data);
         $this->storage->put($projectFile->getFileName(), $this->filesystem->get($data['file']));
         return $projectFile;
     } catch (ValidatorException $e) {
         return ['error' => true, 'message' => $e->getMessageBag()];
     }
 }
开发者ID:estevesklein,项目名称:CodeProject-curso-laravel,代码行数:16,代码来源:ProjectFileService.php

示例11: showMembers

 /**
  * @param $projectId
  *
  * @return array
  */
 public function showMembers($projectId)
 {
     try {
         return $this->repository->skipPresenter()->find($projectId)->members;
     } catch (ValidatorException $e) {
         return ['error' => true, 'message' => $e->getMessageBag()];
     }
 }
开发者ID:felipeminello,项目名称:laravel.angular,代码行数:13,代码来源:ProjectService.php

示例12: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $project = $this->repository->find($id);
     if ($project) {
         $files = $this->repository->skipPresenter()->find($id)->files;
         foreach ($files as $file) {
             $this->fileService->delete($id, $file->id);
         }
         if ($this->repository->delete($id)) {
             return ['success' => true];
         } else {
             return ['success' => false];
         }
     } else {
         return ['success' => false, 'msg' => "Project not found!"];
     }
 }
开发者ID:pedroabarbosa,项目名称:codeproject_curso,代码行数:23,代码来源:ProjectController.php

示例13: removeMember

 public function removeMember(array $data)
 {
     try {
         $project = $this->repositoy->skipPresenter()->find($data['id']);
         $user = $this->user->find($data['$memberId']);
         $project->members()->detach($user);
     } catch (\Exception $e) {
         return ['error' => true, 'message' => $e->getMessage()];
     }
 }
开发者ID:LucasFCastro,项目名称:codeproject,代码行数:10,代码来源:ProjectService.php

示例14: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     try {
         $this->repository->skipPresenter()->find($id)->delete();
     } catch (QueryException $e) {
         return $this->erroMsgm('Projeto não pode ser apagado pois existe um ou mais clientes vinculados a ele.');
     } catch (ModelNotFoundException $e) {
         return $this->erroMsgm('Projeto não encontrado.');
     } catch (NoActiveAccessTokenException $e) {
         return $this->erroMsgm('Usuário não está logado.');
     } catch (\Exception $e) {
         return $this->erroMsgm('Ocorreu um erro ao excluir o projeto.');
     }
 }
开发者ID:Talles-Gazel,项目名称:curso-Laravel5.1-AngularJS,代码行数:20,代码来源:ProjectController.php

示例15: deleteFile

 public function deleteFile($project_id, $file_id)
 {
     try {
         $project = $this->repository->skipPresenter()->find($project_id);
         $file = $project->files->find($file_id);
         if ($file) {
             $file->delete();
             $this->storage->delete($file_id . '.jpg');
         } else {
             return array('error' => 'true', 'message' => 'File does not exist');
         }
     } catch (ModelNotFoundException $e) {
         return ['error' => true, 'message' => $e->getMessage()];
     }
 }
开发者ID:Gabriel-aa,项目名称:curso-laravel,代码行数:15,代码来源:ProjectService.php


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