BookStack\Services\PermissionService::enforceBookRestrictions PHP Метод

enforceBookRestrictions() публичный Метод

Add restrictions to a book query.
public enforceBookRestrictions ( $query, string $action = 'view' ) : mixed
$query
$action string
Результат mixed
    public function enforceBookRestrictions($query, $action = 'view')
    {
        return $this->enforceEntityRestrictions($query, $action);
    }

Usage Example

Пример #1
0
 /**
  * Get the most recently updated books.
  * @param $count
  * @param int $page
  * @return mixed
  */
 public function getRecentlyUpdatedBooks($count = 20, $page = 0)
 {
     return $this->permissionService->enforceBookRestrictions($this->book)->orderBy('updated_at', 'desc')->skip($page * $count)->take($count)->get();
 }