Devise
Class

Devise\Pages\PagesRepository

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)

Create a new PageRepostiry instance.

Page find(int $id, string $versionName = 'Default', bool $editing = false)

finds a record by it's id

Page findByRouteName($name $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

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 availableViewsList()

Get the list of available views

Details

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

Create a new PageRepostiry instance.

Parameters

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

at line 67
public Page find(int $id, string $versionName = 'Default', bool $editing = false)

finds a record by it's id

Parameters

int $id
string $versionName
bool $editing

Return Value

Page

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

finds a record by it's slug

Parameters

$name $name
string $versionName
bool $editing

Return Value

Page

at line 118
public 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 150
public 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 165
public 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 187
public array availableLanguagesForPage(integer $id)

List of all the languages available for a page

Parameters

integer $id

Return Value

array

at line 228
public 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 251
public Collection getRouteList()

Get the route list for all the non admin pages

Return Value

Collection

at line 280
public PageVersion getLivePageVersion($page)

Gets the live version of this page

Parameters

$page

Return Value

PageVersion

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

Gets the page version by name

Parameters

Page $page
string $versionName

Return Value

PageVersion

at line 317
public 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 344
public array availableViewsList()

Get the list of available views

Return Value

array