PHP Class Devise\Templates\TemplatesCleaner

Show file Open project: devisephp/cms

Public Methods

Method Description
__construct ( PagesRepository $PagesRepository, DataBuilder $DataBuilder ) Construct a new template manager
clearTemplateFields ( string $templateName ) : void removes all fields and collection from database

Private Methods

Method Description
deleteCollectionInstances ( array $collectionInstanceIds ) deletes all collection_instances with ids
deleteCollections ( array $collectionIds ) deletes all collections with ids
deleteFields ( array $fieldIds ) deletes all fields with ids
fakeAPageRender ( string $view ) takea view name, finds a route that uses the view runds databuilder, and renders the view as if it were being returned in a route
getActiveKeys ( ) takea view name, finds a route that uses the view runds databuilder, and renders the view as if it were being returned in a route
getAllLivePageVersionIds ( string $view ) query to get all live page version ids
getIdsToDelete ( string $view, array $keys, integer $liveVersionId ) builds an array of ids that need to be deleted
keySearch ( array &$keys, array $data ) recursively loops through data to find keys that equal "key" and adds those to the $keys array

Method Details

__construct() public method

Construct a new template manager
public __construct ( PagesRepository $PagesRepository, DataBuilder $DataBuilder )
$PagesRepository Devise\Pages\PagesRepository
$DataBuilder Devise\Pages\Viewvars\DataBuilder

clearTemplateFields() public method

removes all fields and collection from database
public clearTemplateFields ( string $templateName ) : void
$templateName string
return void