PHP Class Devise\Pages\PagesRepository

Afficher le fichier Open project: devisephp/cms Class Usage Examples

Méthodes publiques

Méthode Description
__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

Méthodes protégées

Méthode Description
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

Method Details

__construct() public méthode

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() public méthode

List of all the languages available for a page
public availableLanguagesForPage ( integer $id, $params = [] ) : array
$id integer
Résultat array

availableViewsList() public méthode

Get the list of available views
public availableViewsList ( ) : array
Résultat array

find() public méthode

finds a record by it's id
public find ( integer $id ) : Page
$id integer
Résultat Page

findByRouteName() public méthode

finds a record by it's slug
public findByRouteName ( $name, string $versionName = null, boolean $editing = false ) : Page
$name
$versionName string
$editing boolean
Résultat Page

findByRouteNameAndPreviewHash() public méthode

Finds the DvsPage by a route name and preview hash
public findByRouteNameAndPreviewHash ( string $name, string $previewHash ) : DvsPage
$name string
$previewHash string
Résultat DvsPage

findLocalizedPage() public méthode

See if a localized version of this page exists if there is no difference we return null
public findLocalizedPage ( Page $page ) : Page
$page Page
Résultat Page

findPageTemplates() public méthode

Find the page templates for this given page
public findPageTemplates ( [type] $page ) : [type]
$page [type]
Résultat [type]

findTemplateVariables() public méthode

Find the page variables for this given page
public findTemplateVariables ( $templates ) : [type]
Résultat [type]

findWithVersion() public méthode

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
Résultat Page

getLivePageVersion() public méthode

Gets the live version of this page
public getLivePageVersion ( Page $page ) : PageVersion
$page Page
Résultat PageVersion

getLivePageVersionByAB() public méthode

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]
Résultat [type]

getLivePageVersionByCookie() public méthode

..
public getLivePageVersionByCookie ( [type] $page ) : [type]
$page [type]
Résultat [type]

getLivePageVersionByDate() public méthode

Gets the live version of this page by date
public getLivePageVersionByDate ( [type] $page ) : [type]
$page [type]
Résultat [type]

getLivePageVersionByDiceRoll() public méthode

Gets the live page version by a dice roll
public getLivePageVersionByDiceRoll ( [type] $page ) : [type]
$page [type]
Résultat [type]

getLivePageVersionById() public méthode

Get the live version of this page by id
public getLivePageVersionById ( [type] $page, [type] $pageVersionId ) : [type]
$page [type]
$pageVersionId [type]
Résultat [type]

getPageVersionByName() public méthode

Gets the page version by name
public getPageVersionByName ( Page $page, string $versionName ) : PageVersion
$page Page
$versionName string
Résultat PageVersion

getPageVersionByPreviewHash() protected méthode

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

getPageVersions() public méthode

Get the versions of a page
public getPageVersions ( integer $pageId, null $selectedPageVersionId = null ) : EloquentCollection[PageVersions]
$pageId integer
$selectedPageVersionId null
Résultat EloquentCollection[PageVersions]

getPageVersionsByAB() public méthode

Gets all live page versions when we are in a A|B testing mode for a page
public getPageVersionsByAB ( [type] $page ) : [type]
$page [type]
Résultat [type]

getPagesList() public méthode

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
Résultat array

getRouteList() public méthode

Get the route list for all the non admin pages
public getRouteList ( ) : Collection
Résultat Collection

getUnUsedLanguageList() public méthode

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
Résultat array

pages() public méthode

Finds lots of pages in the system that are not admin pages and belong to the current language
public pages ( ) : Page
Résultat Page

toHumanDateFormat() protected méthode

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
Résultat string

updateUrlsInField() protected méthode

[updateUrlsInField description]
protected updateUrlsInField ( [type] $field ) : [type]
$field [type]
Résultat [type]

wrapFieldsAroundPage() protected méthode

Wrap all fields around the page
protected wrapFieldsAroundPage ( Page $page, $pageVersion ) : Page
$page Page
$pageVersion
Résultat Page

wrapLanguagesAroundPages() protected méthode

Wraps the available languages for a page
protected wrapLanguagesAroundPages ( Collection $pages ) : Collection
$pages Collection
Résultat Collection

wrapPageVersionStatusByAB() protected méthode

Wrap the status around a single page version
protected wrapPageVersionStatusByAB ( [type] $version, [type] $page, [type] $liveVersions ) : [type]
$version [type]
$page [type]
$liveVersions [type]
Résultat [type]

wrapPageVersionStatusByDate() protected méthode

Wraps the status around a single page version
protected wrapPageVersionStatusByDate ( DvsPageVersion $version, DvsPage $page, DvsPageVersion $liveVersion ) : DvsPageVersion
$version DvsPageVersion
$page DvsPage
$liveVersion DvsPageVersion
Résultat DvsPageVersion

wrapPageVersionStatuses() protected méthode

Wraps the statues around page versions
protected wrapPageVersionStatuses ( $versions, $page ) : Collection
$versions
$page
Résultat Collection

wrapPageVersionStatusesByAB() protected méthode

Wraps AB Page Version Statuses on all versions for the page
protected wrapPageVersionStatusesByAB ( [type] $versions, [type] $page ) : [type]
$versions [type]
$page [type]
Résultat [type]

wrapPageVersionStatusesByDate() protected méthode

[wrapPageVersionStatusesByDate description]
protected wrapPageVersionStatusesByDate ( [type] $versions, [type] $page ) : [type]
$versions [type]
$page [type]
Résultat [type]

wrapTheseCollectionsAroundThisPage() protected méthode

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
Résultat Page

wrapTheseFieldsAroundThisPage() protected méthode

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
Résultat Page