Property | Type | Description | |
---|---|---|---|
$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] |
Property | Type | Description | |
---|---|---|---|
$FieldManager | FieldManager lets us manage the fields | ||
$FieldsRepository | FieldsRepository returns information about fields | ||
$Page | Page | DvsPage model to fetch database dvs_pages | |
$PageFields | array | .. | |
$PageVersionManager | PageVersionManager lets us manage versions of a page | ||
$Validator | Illuminate\Validation\Factory | Validator is used to validate page rules |
Method | Description | |
---|---|---|
__construct ( DvsPage $Page, |
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 |
Method | Description | |
---|---|---|
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 |
public __construct ( DvsPage $Page, |
||
$Page | DvsPage | |
$PageVersionManager | ||
$PageVersionsRepository | ||
$FieldsRepository | ||
$FieldManager | ||
$Framework | ||
$RoutesGenerator | ||
$Language | DvsLanguage |
protected cacheDeviseRoutes ( ) : [type] | ||
return | [type] |
public createNewPage ( $input ) : boolean | ||
return | boolean |
protected createPageFromInput ( array $input ) : DvsPage | ||
$input | array | |
return | DvsPage |
public destroyPage ( integer $id ) : boolean | ||
$id | integer | |
return | boolean |
protected findAvailableRoute ( string $suggestedRoute, $languageId ) : string | ||
$suggestedRoute | string | |
return | string |
protected isValidInputForNewPage ( [type] $input ) : boolean | ||
$input | [type] | |
return | boolean |
public markContentRequestedFieldsComplete ( $pageId ) : string | ||
return | string |
protected setTranslatedFromPageId ( $fromPage, array &$input ) : array | ||
$input | array | |
return | array |
protected setTranslatedFromRouteName ( $fromPage, array &$input ) | ||
$input | array |
public toggleABTesting ( [type] $pageId, [type] $isEnabled ) : [type] | ||
$pageId | [type] | |
$isEnabled | [type] | |
return | [type] |
public updatePageVersionABTestingAmount ( [type] $pageVersionId, [type] $amount ) : [type] | ||
$pageVersionId | [type] | |
$amount | [type] | |
return | [type] |
public updatePageVersionView ( [type] $pageVersionId, [type] $view ) : [type] | ||
$pageVersionId | [type] | |
$view | [type] | |
return | [type] |
protected FieldManager,Devise\Pages\Fields $FieldManager | ||
return |
protected FieldsRepository,Devise\Pages\Fields $FieldsRepository | ||
return |
protected Page $Page | ||
return | Page |
protected PageVersionManager,Devise\Pages $PageVersionManager | ||
return |
protected Illuminate\Validation\Factory $Validator | ||
return | Illuminate\Validation\Factory |
public array $errors | ||
return | array |
public string $message | ||
return | string |