class PagesRepository

Class PagesRepository is used to search and retrieve DvsPage models and things in context of a Devise Page.

Methods

__construct(DvsPage $Page, DvsField $Field, DvsGlobalField $GlobalField, LanguageDetector $LanguageDetector, CollectionsRepository $CollectionsRepository, $Input = null, $Config = null, $URL = null, $File = null, $ViewOpener = null)

Create a new PageRepostiry instance.

Page
find($id)

finds a record by it's id

Page
findWithVersion(int $id, string $versionName = null, bool $editing = false)

finds a record by it's id and provide version and field data

Page
findByRouteName($name, string $versionName = null, bool $editing = false)

finds a record by it's slug

DvsPage
findByRouteNameAndPreviewHash(string $name, string $previewHash)

Finds the DvsPage by a route name and preview hash

Page
findLocalizedPage(Page $page)

See if a localized version of this page exists if there is no difference we return null

[type]
findTemplateVariables($templates)

Find the page variables for this given page

[type]
findPageTemplates([type] $page)

Find the page templates for this given page

Page
pages()

Finds lots of pages in the system that are not admin pages and belong to the current language

array
availableLanguagesForPage(integer $id)

List of all the languages available for a page

EloquentCollection[PageVersions]
getPageVersions(integer $pageId, null $selectedPageVersionId = null)

Get the versions of a page

Collection
getRouteList()

Get the route list for all the non admin pages

PageVersion
getLivePageVersion($page)

Gets the live version of this page

PageVersion
getPageVersionByName(Page $page, string $versionName)

Gets the page version by name

array
getPagesList(boolean $includeAdmin = false, string $search = null)

Gets a list of pages in array format probably used for drop down boxes.

array
getUnUsedLanguageList(integer $pageId, array $languages)

Gets a list of languages that the page has not been translated to or originates from

array
availableViewsList()

Get the list of available views

Details

at line 44
__construct(DvsPage $Page, DvsField $Field, DvsGlobalField $GlobalField, LanguageDetector $LanguageDetector, CollectionsRepository $CollectionsRepository, $Input = null, $Config = null, $URL = null, $File = null, $ViewOpener = null)

Create a new PageRepostiry instance.

Parameters

DvsPage $Page
DvsField $Field
DvsGlobalField $GlobalField
LanguageDetector $LanguageDetector
CollectionsRepository $CollectionsRepository
$Input
$Config
$URL
$File
$ViewOpener

at line 69
Page find($id)

finds a record by it's id

Parameters

$id

Return Value

Page

at line 87
Page findWithVersion(int $id, string $versionName = null, bool $editing = false)

finds a record by it's id and provide version and field data

Parameters

int $id
string $versionName
bool $editing

Return Value

Page

at line 115
Page findByRouteName($name, string $versionName = null, bool $editing = false)

finds a record by it's slug

Parameters

$name
string $versionName
bool $editing

Return Value

Page

at line 141
DvsPage findByRouteNameAndPreviewHash(string $name, string $previewHash)

Finds the DvsPage by a route name and preview hash

Parameters

string $name
string $previewHash

Return Value

DvsPage

at line 173
Page findLocalizedPage(Page $page)

See if a localized version of this page exists if there is no difference we return null

Parameters

Page $page

Return Value

Page

at line 188
[type] findTemplateVariables($templates)

Find the page variables for this given page

Parameters

$templates

Return Value

[type]

at line 210
[type] findPageTemplates([type] $page)

Find the page templates for this given page

Parameters

[type] $page

Return Value

[type]

at line 233
Page pages()

Finds lots of pages in the system that are not admin pages and belong to the current language

Return Value

Page

at line 262
array availableLanguagesForPage(integer $id)

List of all the languages available for a page

Parameters

integer $id

Return Value

array

at line 303
EloquentCollection[PageVersions] getPageVersions(integer $pageId, null $selectedPageVersionId = null)

Get the versions of a page

Parameters

integer $pageId
null $selectedPageVersionId

Return Value

EloquentCollection[PageVersions]

at line 326
Collection getRouteList()

Get the route list for all the non admin pages

Return Value

Collection

at line 358
PageVersion getLivePageVersion($page)

Gets the live version of this page

Parameters

$page

Return Value

PageVersion

at line 382
PageVersion getPageVersionByName(Page $page, string $versionName)

Gets the page version by name

Parameters

Page $page
string $versionName

Return Value

PageVersion

at line 395
array getPagesList(boolean $includeAdmin = false, string $search = null)

Gets a list of pages in array format probably used for drop down boxes.

Parameters

boolean $includeAdmin
string $search

Return Value

array

at line 425
array getUnUsedLanguageList(integer $pageId, array $languages)

Gets a list of languages that the page has not been translated to or originates from

Parameters

integer $pageId
array $languages

Return Value

array

at line 442
array availableViewsList()

Get the list of available views

Return Value

array