PHP 클래스 Devise\Pages\PageManager

파일 보기 프로젝트 열기: devisephp/cms 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$errors array Errors are kept in an array and can be used later if validation fails and we want to know why
$message string This is a message that we can store why the validation failed
$warnings [type] [$warnings description]

보호된 프로퍼티들

프로퍼티 타입 설명
$FieldManager Devise\Pages\Fields\FieldManager FieldManager lets us manage the fields
$FieldsRepository Devise\Pages\Fields\FieldsRepository FieldsRepository returns information about fields
$Page Page DvsPage model to fetch database dvs_pages
$PageFields array ..
$PageVersionManager PageVersionManager PageVersionManager lets us manage versions of a page
$Validator Illuminate\Validation\Factory Validator is used to validate page rules

공개 메소드들

메소드 설명
__construct ( DvsPage $Page, PageVersionManager $PageVersionManager, PageVersionsRepository $PageVersionsRepository, FieldsRepository $FieldsRepository, FieldManager $FieldManager, Framework $Framework, RoutesGenerator $RoutesGenerator, DvsLanguage $Language ) Construct a new page manager
copyPage ( integer $fromPageId, array $input ) : DvsPage Takes the input provided and runs the create method after stripping necessary fields.
createNewPage ( $input ) : boolean Validates and creates a page with the given input
destroyPage ( integer $id ) : boolean Destroys a page
markContentRequestedFieldsComplete ( $pageId ) : string Marks all page's fields with a "true" content_requested value as complete
toggleABTesting ( [type] $pageId, [type] $isEnabled ) : [type] [toggleABTesting description]
updatePage ( integer $id, array $input ) : boolean Validates and updates a page with the given input
updatePageVersionABTestingAmount ( [type] $pageVersionId, [type] $amount ) : [type] [updatePageVersionABTestingAmount description]
updatePageVersionDates ( integer $pageVersionId, array $input ) : void Updates the page version dates
updatePageVersionView ( [type] $pageVersionId, [type] $view ) : [type] Updates the page version view

보호된 메소드들

메소드 설명
cacheDeviseRoutes ( ) : [type] Cache the devise routes, and make sure to catch an exception. Exception thrown is likely due to serialization error caused by caching routes with closures in them
createPageFromInput ( array $input ) : DvsPage Creates a page from the given input data
findAvailableRoute ( string $suggestedRoute, $languageId ) : string This helper method keeps looking through suggested route names and adding a number onto the suggested route until it finds an available one that isn't taken in the database. We don't want route names to be the same ever as they should be unique so this helps us accomplish that.
isValidInputForNewPage ( [type] $input ) : boolean [isValidInputForNewPage description]
setTranslatedFromPageId ( $fromPage, array &$input ) : array This ensures that we are translating from the correct "parent" page.
setTranslatedFromRouteName ( $fromPage, array &$input ) Sets the route_name equal to the orignal page's route_name

메소드 상세

__construct() 공개 메소드

Construct a new page manager
public __construct ( DvsPage $Page, PageVersionManager $PageVersionManager, PageVersionsRepository $PageVersionsRepository, FieldsRepository $FieldsRepository, FieldManager $FieldManager, Framework $Framework, RoutesGenerator $RoutesGenerator, DvsLanguage $Language )
$Page DvsPage
$PageVersionManager PageVersionManager
$PageVersionsRepository PageVersionsRepository
$FieldsRepository Devise\Pages\Fields\FieldsRepository
$FieldManager Devise\Pages\Fields\FieldManager
$Framework Devise\Support\Framework
$RoutesGenerator RoutesGenerator
$Language DvsLanguage

cacheDeviseRoutes() 보호된 메소드

Cache the devise routes, and make sure to catch an exception. Exception thrown is likely due to serialization error caused by caching routes with closures in them
protected cacheDeviseRoutes ( ) : [type]
리턴 [type]

copyPage() 공개 메소드

Takes the input provided and runs the create method after stripping necessary fields.
public copyPage ( integer $fromPageId, array $input ) : DvsPage
$fromPageId integer
$input array
리턴 DvsPage

createNewPage() 공개 메소드

Validates and creates a page with the given input
public createNewPage ( $input ) : boolean
리턴 boolean

createPageFromInput() 보호된 메소드

Creates a page from the given input data
protected createPageFromInput ( array $input ) : DvsPage
$input array
리턴 DvsPage

destroyPage() 공개 메소드

Destroys a page
public destroyPage ( integer $id ) : boolean
$id integer
리턴 boolean

findAvailableRoute() 보호된 메소드

This helper method keeps looking through suggested route names and adding a number onto the suggested route until it finds an available one that isn't taken in the database. We don't want route names to be the same ever as they should be unique so this helps us accomplish that.
protected findAvailableRoute ( string $suggestedRoute, $languageId ) : string
$suggestedRoute string
리턴 string

isValidInputForNewPage() 보호된 메소드

[isValidInputForNewPage description]
protected isValidInputForNewPage ( [type] $input ) : boolean
$input [type]
리턴 boolean

markContentRequestedFieldsComplete() 공개 메소드

Marks all page's fields with a "true" content_requested value as complete
public markContentRequestedFieldsComplete ( $pageId ) : string
리턴 string

setTranslatedFromPageId() 보호된 메소드

This happens when a user creates a page and then copies that "parent" page to a "child" page. When the user tries to copy the "child" page to a "grandchild" page. We want the "grandchild" to be a "child" instead of a "grandchild". This keeps page nesting down to 1 level instead of nesting under many levels.
protected setTranslatedFromPageId ( $fromPage, array &$input ) : array
$input array
리턴 array

setTranslatedFromRouteName() 보호된 메소드

Sets the route_name equal to the orignal page's route_name
protected setTranslatedFromRouteName ( $fromPage, array &$input )
$input array

toggleABTesting() 공개 메소드

[toggleABTesting description]
public toggleABTesting ( [type] $pageId, [type] $isEnabled ) : [type]
$pageId [type]
$isEnabled [type]
리턴 [type]

updatePage() 공개 메소드

Validates and updates a page with the given input
public updatePage ( integer $id, array $input ) : boolean
$id integer
$input array
리턴 boolean

updatePageVersionABTestingAmount() 공개 메소드

[updatePageVersionABTestingAmount description]
public updatePageVersionABTestingAmount ( [type] $pageVersionId, [type] $amount ) : [type]
$pageVersionId [type]
$amount [type]
리턴 [type]

updatePageVersionDates() 공개 메소드

Updates the page version dates
public updatePageVersionDates ( integer $pageVersionId, array $input ) : void
$pageVersionId integer
$input array
리턴 void

updatePageVersionView() 공개 메소드

Updates the page version view
public updatePageVersionView ( [type] $pageVersionId, [type] $view ) : [type]
$pageVersionId [type]
$view [type]
리턴 [type]

프로퍼티 상세

$FieldManager 보호되어 있는 프로퍼티

FieldManager lets us manage the fields
protected FieldManager,Devise\Pages\Fields $FieldManager
리턴 Devise\Pages\Fields\FieldManager

$FieldsRepository 보호되어 있는 프로퍼티

FieldsRepository returns information about fields
protected FieldsRepository,Devise\Pages\Fields $FieldsRepository
리턴 Devise\Pages\Fields\FieldsRepository

$Page 보호되어 있는 프로퍼티

DvsPage model to fetch database dvs_pages
protected Page $Page
리턴 Page

$PageFields 보호되어 있는 정적으로 프로퍼티

..
protected static array $PageFields
리턴 array

$PageVersionManager 보호되어 있는 프로퍼티

PageVersionManager lets us manage versions of a page
protected PageVersionManager,Devise\Pages $PageVersionManager
리턴 PageVersionManager

$Validator 보호되어 있는 프로퍼티

Validator is used to validate page rules
protected Illuminate\Validation\Factory $Validator
리턴 Illuminate\Validation\Factory

$errors 공개적으로 프로퍼티

Errors are kept in an array and can be used later if validation fails and we want to know why
public array $errors
리턴 array

$message 공개적으로 프로퍼티

This is a message that we can store why the validation failed
public string $message
리턴 string

$warnings 공개적으로 프로퍼티

[$warnings description]
public [type] $warnings
리턴 [type]