1 <?php namespace BookStack\Repos;
16 * EntityService constructor.
21 public function __construct(Book $book, Chapter $chapter, Page $page)
24 $this->chapter = $chapter;
29 * Get the latest books added to the system.
33 public function getRecentlyCreatedBooks($count = 20, $page = 0)
35 return $this->book->orderBy('created_at', 'desc')->skip($page*$count)->take($count)->get();
39 * Get the most recently updated books.
44 public function getRecentlyUpdatedBooks($count = 20, $page = 0)
46 return $this->book->orderBy('updated_at', 'desc')->skip($page*$count)->take($count)->get();
50 * Get the latest pages added to the system.
54 public function getRecentlyCreatedPages($count = 20, $page = 0)
56 return $this->page->orderBy('created_at', 'desc')->skip($page*$count)->take($count)->get();
60 * Get the most recently updated pages.
65 public function getRecentlyUpdatedPages($count = 20, $page = 0)
67 return $this->page->orderBy('updated_at', 'desc')->skip($page*$count)->take($count)->get();