Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class NovelApi {
- protected $repository;
- public function __construct(NovelRepositoryContract $repository)
- {
- $this->repository = $repository;
- }
- public function getById($id)
- {
- return $this->repository->getById($id);
- }
- public function getByIds($id)
- {
- return $this->repository->getByIds($id);
- }
- // ... implements getByOwnerId ละไว้นะ
- public function create($data)
- {
- return $this->repository->create($data);
- }
- public function update($id, $updates)
- {
- return $this->repository->update($id, $updates);
- }
- // .. ย่ออีก
- public function ban($id, $updates)
- {
- return $this->repository->update($id, ['ban' => 1]);
- }
- }
Add Comment
Please, Sign In to add comment