Example #1
0
 public function delete($id)
 {
     $entity = Project::find($id);
     if (is_null($entity)) {
         return Errors::invalidId($id);
     }
     foreach ($entity->tasks as $task) {
         $this->projectTaskService->delete($task->id);
     }
     foreach ($entity->memberAssociations as $pm) {
         $this->projectMemberService->delete($pm->id);
     }
     $this->repository->delete($id);
     return ['message' => "Registro deletado!"];
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id, $idTask)
 {
     $this->service->delete($idTask);
     //$this->repository->delete($idTask);
     /*
     //return $this->repository->delete($taskId);
     
     $projectTask = $this->repository->skipPresenter()->find($id);
     //$result = $this->repository->delete($id);
     
     $projectId = $projectTask->project_id;
     
     if($this->checkProjectTaskPermissions($projectId) == false){
         return ['error' => 'Access Forbidden'];
     }
     
     $result = $projectTask->delete();
     
     if($result)
         return ['error' => 0];
     
     return  ['error' => 1, 'msg' => 'Erro ao tentar deletar a Task'];
     */
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     return $this->service->delete($id);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id, $idTask)
 {
     $this->service->delete($idTask);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id, $taskId)
 {
     $this->service->delete($taskId);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @param $idTask
  * @return Response
  */
 public function destroy($id, $idTask)
 {
     $this->service->delete($idTask);
     //$this->repository->find($idTask)->delete();
 }