PHP Класс Devise\Pages\PagesRepository

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( DvsPage $Page, DvsField $Field, DvsGlobalField $GlobalField, LanguageDetector $LanguageDetector, CollectionsRepository $CollectionsRepository, null $Input = null, null $Config = null, null $URL = null, $File = null, $ViewOpener = null ) Create a new PageRepostiry instance.
availableLanguagesForPage ( integer $id, $params = [] ) : array List of all the languages available for a page
availableViewsList ( ) : array Get the list of available views
find ( integer $id ) : Page finds a record by it's id
findByRouteName ( $name, string $versionName = null, boolean $editing = false ) : Page finds a record by it's slug
findByRouteNameAndPreviewHash ( string $name, string $previewHash ) : DvsPage Finds the DvsPage by a route name and preview hash
findLocalizedPage ( Page $page ) : Page See if a localized version of this page exists if there is no difference we return null
findPageTemplates ( [type] $page ) : [type] Find the page templates for this given page
findTemplateVariables ( $templates ) : [type] Find the page variables for this given page
findWithVersion ( integer $id, string $versionName = null, boolean $editing = false ) : Page finds a record by it's id and provide version and field data
getLivePageVersion ( Page $page ) : PageVersion Gets the live version of this page
getLivePageVersionByAB ( [type] $page ) : [type] Get the live page using ab testing logic. This will first search for a cookie and if no version is found it will use the dice roll. If no page version is found with this dice roll then it will resort back to using the old "dates" system.
getLivePageVersionByCookie ( [type] $page ) : [type] Checks to see if the page already has a cookie set so this user doesn't see different page versions all the time.
getLivePageVersionByDate ( [type] $page ) : [type] Gets the live version of this page by date
getLivePageVersionByDiceRoll ( [type] $page ) : [type] Gets the live page version by a dice roll
getLivePageVersionById ( [type] $page, [type] $pageVersionId ) : [type] Get the live version of this page by id
getPageVersionByName ( Page $page, string $versionName ) : PageVersion Gets the page version by name
getPageVersions ( integer $pageId, null $selectedPageVersionId = null ) : EloquentCollection[PageVersions] Get the versions of a page
getPageVersionsByAB ( [type] $page ) : [type] Gets all live page versions when we are in a A|B testing mode for a page
getPagesList ( boolean $includeAdmin = false, string $search = null ) : array Gets a list of pages in array format probably used for drop down boxes.
getRouteList ( ) : Collection Get the route list for all the non admin pages
getUnUsedLanguageList ( integer $pageId, array $languages ) : array Gets a list of languages that the page has not been translated to or originates from
pages ( ) : Page Finds lots of pages in the system that are not admin pages and belong to the current language

Защищенные методы

Метод Описание
getPageVersionByPreviewHash ( $page, $previewHash ) * Gets the page version by a hash
toHumanDateFormat ( Datetime $timestamp, string $to = 'm/d/y H:i:s' ) : string To human date format converts this to a readable human format
updateUrlsInField ( [type] $field ) : [type] [updateUrlsInField description]
wrapFieldsAroundPage ( Page $page, $pageVersion ) : Page Wrap all fields around the page
wrapLanguagesAroundPages ( Collection $pages ) : Collection Wraps the available languages for a page
wrapPageVersionStatusByAB ( [type] $version, [type] $page, [type] $liveVersions ) : [type] Wrap the status around a single page version
wrapPageVersionStatusByDate ( DvsPageVersion $version, DvsPage $page, DvsPageVersion $liveVersion ) : DvsPageVersion Wraps the status around a single page version
wrapPageVersionStatuses ( $versions, $page ) : Collection Wraps the statues around page versions
wrapPageVersionStatusesByAB ( [type] $versions, [type] $page ) : [type] Wraps AB Page Version Statuses on all versions for the page
wrapPageVersionStatusesByDate ( [type] $versions, [type] $page ) : [type] [wrapPageVersionStatusesByDate description]
wrapTheseCollectionsAroundThisPage ( $collections, Page $page ) : Page Takes a list of collections and wraps the page with those collections so we can access them dynamically.
wrapTheseFieldsAroundThisPage ( array $fields, Page $page ) : Page Takes a list of fields and a page and puts those field values onto a page object to return

Описание методов

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

Create a new PageRepostiry instance.
public __construct ( DvsPage $Page, DvsField $Field, DvsGlobalField $GlobalField, LanguageDetector $LanguageDetector, CollectionsRepository $CollectionsRepository, null $Input = null, null $Config = null, null $URL = null, $File = null, $ViewOpener = null )
$Page DvsPage
$Field DvsField
$GlobalField DvsGlobalField
$LanguageDetector Devise\Languages\LanguageDetector
$CollectionsRepository Devise\Pages\Collections\CollectionsRepository
$Input null
$Config null
$URL null

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

List of all the languages available for a page
public availableLanguagesForPage ( integer $id, $params = [] ) : array
$id integer
Результат array

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

Get the list of available views
public availableViewsList ( ) : array
Результат array

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

finds a record by it's id
public find ( integer $id ) : Page
$id integer
Результат Page

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

finds a record by it's slug
public findByRouteName ( $name, string $versionName = null, boolean $editing = false ) : Page
$name
$versionName string
$editing boolean
Результат Page

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

Finds the DvsPage by a route name and preview hash
public findByRouteNameAndPreviewHash ( string $name, string $previewHash ) : DvsPage
$name string
$previewHash string
Результат DvsPage

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

See if a localized version of this page exists if there is no difference we return null
public findLocalizedPage ( Page $page ) : Page
$page Page
Результат Page

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

Find the page templates for this given page
public findPageTemplates ( [type] $page ) : [type]
$page [type]
Результат [type]

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

Find the page variables for this given page
public findTemplateVariables ( $templates ) : [type]
Результат [type]

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

finds a record by it's id and provide version and field data
public findWithVersion ( integer $id, string $versionName = null, boolean $editing = false ) : Page
$id integer
$versionName string
$editing boolean
Результат Page

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

Gets the live version of this page
public getLivePageVersion ( Page $page ) : PageVersion
$page Page
Результат PageVersion

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

Get the live page using ab testing logic. This will first search for a cookie and if no version is found it will use the dice roll. If no page version is found with this dice roll then it will resort back to using the old "dates" system.
public getLivePageVersionByAB ( [type] $page ) : [type]
$page [type]
Результат [type]

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

..
public getLivePageVersionByCookie ( [type] $page ) : [type]
$page [type]
Результат [type]

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

Gets the live version of this page by date
public getLivePageVersionByDate ( [type] $page ) : [type]
$page [type]
Результат [type]

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

Gets the live page version by a dice roll
public getLivePageVersionByDiceRoll ( [type] $page ) : [type]
$page [type]
Результат [type]

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

Get the live version of this page by id
public getLivePageVersionById ( [type] $page, [type] $pageVersionId ) : [type]
$page [type]
$pageVersionId [type]
Результат [type]

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

Gets the page version by name
public getPageVersionByName ( Page $page, string $versionName ) : PageVersion
$page Page
$versionName string
Результат PageVersion

getPageVersionByPreviewHash() защищенный Метод

* Gets the page version by a hash
protected getPageVersionByPreviewHash ( $page, $previewHash )
$page
$previewHash

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

Get the versions of a page
public getPageVersions ( integer $pageId, null $selectedPageVersionId = null ) : EloquentCollection[PageVersions]
$pageId integer
$selectedPageVersionId null
Результат EloquentCollection[PageVersions]

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

Gets all live page versions when we are in a A|B testing mode for a page
public getPageVersionsByAB ( [type] $page ) : [type]
$page [type]
Результат [type]

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

Gets a list of pages in array format probably used for drop down boxes.
public getPagesList ( boolean $includeAdmin = false, string $search = null ) : array
$includeAdmin boolean
$search string
Результат array

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

Get the route list for all the non admin pages
public getRouteList ( ) : Collection
Результат Collection

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

Gets a list of languages that the page has not been translated to or originates from
public getUnUsedLanguageList ( integer $pageId, array $languages ) : array
$pageId integer
$languages array
Результат array

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

Finds lots of pages in the system that are not admin pages and belong to the current language
public pages ( ) : Page
Результат Page

toHumanDateFormat() защищенный Метод

To human date format converts this to a readable human format
protected toHumanDateFormat ( Datetime $timestamp, string $to = 'm/d/y H:i:s' ) : string
$timestamp Datetime
$to string
Результат string

updateUrlsInField() защищенный Метод

[updateUrlsInField description]
protected updateUrlsInField ( [type] $field ) : [type]
$field [type]
Результат [type]

wrapFieldsAroundPage() защищенный Метод

Wrap all fields around the page
protected wrapFieldsAroundPage ( Page $page, $pageVersion ) : Page
$page Page
$pageVersion
Результат Page

wrapLanguagesAroundPages() защищенный Метод

Wraps the available languages for a page
protected wrapLanguagesAroundPages ( Collection $pages ) : Collection
$pages Collection
Результат Collection

wrapPageVersionStatusByAB() защищенный Метод

Wrap the status around a single page version
protected wrapPageVersionStatusByAB ( [type] $version, [type] $page, [type] $liveVersions ) : [type]
$version [type]
$page [type]
$liveVersions [type]
Результат [type]

wrapPageVersionStatusByDate() защищенный Метод

Wraps the status around a single page version
protected wrapPageVersionStatusByDate ( DvsPageVersion $version, DvsPage $page, DvsPageVersion $liveVersion ) : DvsPageVersion
$version DvsPageVersion
$page DvsPage
$liveVersion DvsPageVersion
Результат DvsPageVersion

wrapPageVersionStatuses() защищенный Метод

Wraps the statues around page versions
protected wrapPageVersionStatuses ( $versions, $page ) : Collection
$versions
$page
Результат Collection

wrapPageVersionStatusesByAB() защищенный Метод

Wraps AB Page Version Statuses on all versions for the page
protected wrapPageVersionStatusesByAB ( [type] $versions, [type] $page ) : [type]
$versions [type]
$page [type]
Результат [type]

wrapPageVersionStatusesByDate() защищенный Метод

[wrapPageVersionStatusesByDate description]
protected wrapPageVersionStatusesByDate ( [type] $versions, [type] $page ) : [type]
$versions [type]
$page [type]
Результат [type]

wrapTheseCollectionsAroundThisPage() защищенный Метод

Takes a list of collections and wraps the page with those collections so we can access them dynamically.
protected wrapTheseCollectionsAroundThisPage ( $collections, Page $page ) : Page
$collections
$page Page
Результат Page

wrapTheseFieldsAroundThisPage() защищенный Метод

Takes a list of fields and a page and puts those field values onto a page object to return
protected wrapTheseFieldsAroundThisPage ( array $fields, Page $page ) : Page
$fields array
$page Page
Результат Page