1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Finished refactor of entity repos

Removed entity-specific repos and standardised
the majority of repo calls to be applicable to
all entity types
This commit is contained in:
Dan Brown
2017-01-02 11:07:27 +00:00
parent 65796cfc7b
commit 8453191dfb
16 changed files with 756 additions and 950 deletions

View File

@ -18,11 +18,12 @@ class Chapter extends Entity
/**
* Get the pages that this chapter contains.
* @param string $dir
* @return mixed
*/
public function pages()
public function pages($dir = 'ASC')
{
return $this->hasMany(Page::class)->orderBy('priority', 'ASC');
return $this->hasMany(Page::class)->orderBy('priority', $dir);
}
/**