本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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"]);
}
}
示例5: destroy
public function destroy($id)
{
try {
return $this->repository->delete($id);
} catch (ModelNotFoundException $e) {
return ['error' => true, 'message' => 'Projeto não encontrado'];
}
}
示例6: delete
public function delete($id)
{
$response = $this->repository->delete($id);
if ($response === true) {
return ['success' => true];
}
return $response;
}
示例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()];
}
}
示例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'];
}
}
示例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()];
}
}
示例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;
}
示例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);
}
}
}
示例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()];
}
}
示例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);
}
示例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()];
}
示例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];
}
}