postNotesService = $postNotesService; $this->privilegeService = $privilegeService; } public function getMethods() { return ['DELETE']; } public function getUrl() { return '/api/notes/:postNoteId'; } public function work($args) { $postNote = $this->postNotesService->getById($args['postNoteId']); $this->privilegeService->assertPrivilege(Privilege::DELETE_POST_NOTES); return $this->postNotesService->deletePostNote($postNote); } }