PHP Class BookStack\Repos\EntityRepo

显示文件 Open project: ssddanbrown/bookstack Class Usage Examples

Public Properties

Property Type Description
$book BookStack\Book
$chapter BookStack\Chapter
$page BookStack\Page

Protected Properties

Property Type Description
$permissionService BookStack\Services\PermissionService
$queryOperators array Acceptable operators to be used in a query

Public Methods

Method Description
__construct ( ) EntityService constructor.
buildJointPermissions ( Collection $collection ) Alias method to update the book jointPermissions in the PermissionService.
getRecentlyCreatedBooks ( integer $count = 20, integer $page, boolean $additionalQuery = false ) Get the latest books added to the system.
getRecentlyCreatedChapters ( integer $count = 20, integer $page, boolean $additionalQuery = false ) Get the latest chapters added to the system.
getRecentlyCreatedPages ( integer $count = 20, integer $page, boolean $additionalQuery = false ) Get the latest pages added to the system.
getRecentlyUpdatedBooks ( $count = 20, integer $page ) : mixed Get the most recently updated books.
getRecentlyUpdatedPages ( $count = 20, integer $page ) : mixed Get the most recently updated pages.
getUserDraftPages ( integer $count = 20, integer $page ) Get draft pages owned by the current user.
prepareSearchTerms ( $termString ) : array Prepare a string of search terms by turning it into an array of terms.
updateEntityPermissionsFromRequest ( $request, Entity $entity ) Updates entity restrictions from a request

Protected Methods

Method Description
addAdvancedSearchQueries ( $query, $termString ) : mixed Parses advanced search notations and adds them to the db query.
applyTagSearches ( $query, $tags ) : mixed Apply extracted tag search terms onto a entity query.
cleanSearchTermString ( $termString ) : mixed Removes any special search notation that should not be used in a full-text search.
getRegexEscapedOperators ( ) : mixed Get the available query operators as a regex escaped list.
nameToSlug ( $name ) : string Format a name as a url slug.

Method Details

__construct() public method

EntityService constructor.
public __construct ( )

addAdvancedSearchQueries() protected method

Parses advanced search notations and adds them to the db query.
protected addAdvancedSearchQueries ( $query, $termString ) : mixed
$query
$termString
return mixed

applyTagSearches() protected method

Apply extracted tag search terms onto a entity query.
protected applyTagSearches ( $query, $tags ) : mixed
$query
$tags
return mixed

buildJointPermissions() public method

Alias method to update the book jointPermissions in the PermissionService.
public buildJointPermissions ( Collection $collection )
$collection Illuminate\Support\Collection collection on entities

cleanSearchTermString() protected method

Removes any special search notation that should not be used in a full-text search.
protected cleanSearchTermString ( $termString ) : mixed
$termString
return mixed

getRecentlyCreatedBooks() public method

Get the latest books added to the system.
public getRecentlyCreatedBooks ( integer $count = 20, integer $page, boolean $additionalQuery = false )
$count integer
$page integer
$additionalQuery boolean

getRecentlyCreatedChapters() public method

Get the latest chapters added to the system.
public getRecentlyCreatedChapters ( integer $count = 20, integer $page, boolean $additionalQuery = false )
$count integer
$page integer
$additionalQuery boolean

getRecentlyCreatedPages() public method

Get the latest pages added to the system.
public getRecentlyCreatedPages ( integer $count = 20, integer $page, boolean $additionalQuery = false )
$count integer
$page integer
$additionalQuery boolean

getRecentlyUpdatedBooks() public method

Get the most recently updated books.
public getRecentlyUpdatedBooks ( $count = 20, integer $page ) : mixed
$count
$page integer
return mixed

getRecentlyUpdatedPages() public method

Get the most recently updated pages.
public getRecentlyUpdatedPages ( $count = 20, integer $page ) : mixed
$count
$page integer
return mixed

getRegexEscapedOperators() protected method

Get the available query operators as a regex escaped list.
protected getRegexEscapedOperators ( ) : mixed
return mixed

getUserDraftPages() public method

Get draft pages owned by the current user.
public getUserDraftPages ( integer $count = 20, integer $page )
$count integer
$page integer

nameToSlug() protected method

Format a name as a url slug.
protected nameToSlug ( $name ) : string
$name
return string

prepareSearchTerms() public method

Keeps quoted terms together.
public prepareSearchTerms ( $termString ) : array
$termString
return array

updateEntityPermissionsFromRequest() public method

Updates entity restrictions from a request
public updateEntityPermissionsFromRequest ( $request, Entity $entity )
$request
$entity BookStack\Entity

Property Details

$book public_oe property

public Book,BookStack $book
return BookStack\Book

$chapter public_oe property

public Chapter,BookStack $chapter
return BookStack\Chapter

$page public_oe property

public Page,BookStack $page
return BookStack\Page

$permissionService protected_oe property

protected PermissionService,BookStack\Services $permissionService
return BookStack\Services\PermissionService

$queryOperators protected_oe property

Acceptable operators to be used in a query
protected array $queryOperators
return array