Guest User

Untitled

a guest
Feb 16th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <?php
  2.  
  3. class NovelApi {
  4.  
  5. protected $repository;
  6.  
  7. public function __construct(NovelRepositoryContract $repository)
  8. {
  9. $this->repository = $repository;
  10. }
  11.  
  12. public function getById($id)
  13. {
  14. return $this->repository->getById($id);
  15. }
  16.  
  17. public function getByIds($id)
  18. {
  19. return $this->repository->getByIds($id);
  20. }
  21.  
  22. // ... implements getByOwnerId ละไว้นะ
  23.  
  24. public function create($data)
  25. {
  26. return $this->repository->create($data);
  27. }
  28.  
  29. public function update($id, $updates)
  30. {
  31. return $this->repository->update($id, $updates);
  32. }
  33.  
  34. // .. ย่ออีก
  35.  
  36. public function ban($id, $updates)
  37. {
  38. return $this->repository->update($id, ['ban' => 1]);
  39. }
  40.  
  41. }
Add Comment
Please, Sign In to add comment