com\setasign\SetaSite\Page
Pages
File: /SetaSite/src/Page/Pages.php
Class hierarchy
Summary
Methods
- __construct()
- addChange()
- approveChange()
- checkPathExist()
- checkTemplateIsInUse()
- create()
- createByPage()
- createPageObjectByRow()
- delete()
- findTemplatePageUsages()
- getAllChanges()
- getAllPages()
- getBlockFactory()
- getChanges()
- getChangesTable()
- getChildIdsByPath()
- getMultiplePagePathsByIds()
- getNewOrder()
- getNextPageInOrder()
- getPageSettings()
- getPageTable()
- getPageTree()
- getParentPath()
- getPathById()
- hasChange()
- hasChildChanges()
- hasChildren()
- hasTemplateChange()
- loadById()
- loadByPath()
- revertChange()
- save()
- saveRenderData()
- updatePath()
Constants
CHANGE_CREATE
CHANGE_MOVE
CHANGE_UPDATE
EVENT_AFTER_DELETE
Will be called after a page was finally deleted.
Type: Event
extraParams:
'ids' => int[] The page ids of the deleted pages
'language' => string
EVENT_AFTER_RENDER_DATA_SAVE
Will be called after a render data save was executed
Type: PageEvent
EVENT_AFTER_SAVE
Will be called after a page and it's changes was successfully saved.
Type: PageEvent
extraParams:
'pageRow' => Row
'newPage' => boolean
EVENT_SAVE
Will be called when the permission is needed whether the page can be created.
Type: PageEvent
extraParams:
'pageRow' => &Row
'newPage' => boolean
PATHORDER_STEPS
PATH_HOME
PATH_ID_HOME
PATH_ID_TEMPLATE
PATH_ID_TRASH
PATH_TEMPLATE
PATH_TRASH
Properties
$changesTable
$changesTableOptions
$eventManager
$pageHistory
$pageSettings
$pageTable
$pageTableOptions
$propertiesConfig
Methods
__construct()
\com\setasign\SetaSite\Config\PageProperties $pageProperties,
\com\setasign\SetaFramework\Database\Database $db,
\com\setasign\SetaFramework\EventManager\EventManager $eventManager,
PageHistory $pageHistory,
PageSettings $pageSettings,
\com\setasign\SetaFramework\Database\JoinedTable\JoinedTable $pageTable,
\com\setasign\SetaFramework\Database\Table\Table $changesTable
Parameters
- $blockFactory : \com\setasign\SetaSite\Block\BlockFactory
- $pageProperties : \com\setasign\SetaSite\Config\PageProperties
- $db : \com\setasign\SetaFramework\Database\Database
- $eventManager : \com\setasign\SetaFramework\EventManager\EventManager
- $pageHistory : PageHistory
- $pageSettings : PageSettings
- $pageTable : \com\setasign\SetaFramework\Database\JoinedTable\JoinedTable
- $changesTable : \com\setasign\SetaFramework\Database\Table\Table
approveChange()
Parameters
- $page : Page
- $user : \com\setasign\SetaSite\User\User
- $onlyType : ?int
Exceptions
Throws \com\setasign\SetaSite\BlockManager\BlockFinalException
Throws \com\setasign\SetaSite\Exception
Throws UnapprovedException
Throws \com\setasign\SetaSite\BlockManager\UnknownBlockException
Throws UnknownPageException
Throws \Throwable
Throws \com\setasign\SetaFramework\Exception
checkPathExist()
?int $id = null,
?int $version = null,
?string $language = null
Parameters
- $path : string
- $id : ?int
- $version : ?int
- $language : ?string
checkTemplateIsInUse()
string $ignorePath,
?string $language = null
Parameters
- $templateId : int
- $ignorePath : string
- $language : ?string
create()
string $path,
bool $isTemplate,
?string $language = null,
string|int|null $template = null,
?int $beforePageId = null
Parameters
- $parentId : int
- $path : string
- $isTemplate : bool
- $language : ?string
- $template : string|int|null
- $beforePageId : ?int
Exceptions
Throws \com\setasign\SetaSite\Exception
Throws UnknownPageException
createByPage()
delete()
Beim finalen Löschen -> Sonderfall, dass Kindelemente eventuell noch ausstehende Änderungen haben muss beachtet werden. Finales Löschen muss verhindert werden bis keine ausstehenden Änderungen mehr vorhanden sind.
Parameters
- $page : Page
- $user : \com\setasign\SetaSite\User\User
Exceptions
Throws \com\setasign\SetaSite\Exception
Throws UnapprovedException
Throws UnknownPageException
Throws \Throwable
Throws \com\setasign\SetaFramework\Exception
Throws \com\setasign\SetaSite\BlockManager\BlockFinalException
Throws \com\setasign\SetaSite\BlockManager\UnknownBlockException
findTemplatePageUsages()
?int $version = null,
?string $language = null
Parameters
- $templatePath : string
- $version : ?int
- $language : ?string
getChildIdsByPath()
?int $version = null,
?string $language = null
Returns all ids of all childs(recursive) in $path
Parameters
- $path : string
- $version : ?int
- $language : ?string
getMultiplePagePathsByIds()
?int $version = null
Parameters
- $pages : array<int, array{id: int, language: string}>
- $version : ?int
getNewOrder()
?int $beforePageId = null,
?string $language = null
Parameters
- $parentId : int
- $beforePageId : ?int
- $language : ?string
Exceptions
getNextPageInOrder()
int $parentId,
?int $version = null,
?string $language = null
This method will return the id of the next page in order or NULL
Parameters
- $pageId : int
- $parentId : int
- $version : ?int
- $language : ?string
Exceptions
Throws UnknownPageException
getPageTree()
?int $version = null,
?string $language = null,
bool $recursive = true
Parameters
- $rootNodeId : ?int
- $version : ?int
- $language : ?string
- $recursive : bool
getParentPath()
?int $version = null,
?string $language = null
Parameters
- $parentId : int
- $version : ?int
- $language : ?string
getPathById()
Parameters
- $id : int
- $version : ?int
- $language : ?string
Return Values
NULL if ID doesn't exists.
hasChildChanges()
Parameters
- $page : Page
- $user : ?int
hasTemplateChange()
Parameters
- $page : Page
Exceptions
Throws \com\setasign\SetaSite\PropertyContainer\InvalidValueException
loadById()
?int $version = null,
?string $language = null,
bool $onlyActive = false
Load a page or a template by its ID.
Parameters
- $id : int
- $version : ?int
- $language : ?string
- $onlyActive : bool
If false inactive pages count as not existing.
Exceptions
Throws UnknownPageException
loadByPath()
?int $version = null,
?string $language = null,
bool $catchControllerRoutes = true
Load a page by its path.
If not in backendMode(version == 1), you can't find pages in trash or template and you can only find active pages.
If in backendMode(version == 0), you can find only workingVersions of the pages.
Parameters
- $path : string
- $version : ?int
- $language : ?string
- $catchControllerRoutes : bool
If this is false only pages with the exact same path will be matched
Exceptions
Throws UnknownPageException
revertChange()
Parameters
- $page : Page
- $user : \com\setasign\SetaSite\User\User
- $onlyType : ?int
Exceptions
Throws \com\setasign\SetaSite\Exception
Throws \Throwable
save()
\com\setasign\SetaSite\User\User $user,
bool $changeFinished = true,
bool $logChanges = true,
bool $skipValidation = false
Parameters
- $page : Page
- $user : \com\setasign\SetaSite\User\User
- $changeFinished : bool
- $logChanges : bool
- $skipValidation : bool
Be careful with this option!!
Exceptions
Throws \com\setasign\SetaSite\PropertyContainer\InvalidValueException
Throws UnknownPageException
Throws \Throwable
Throws \com\setasign\SetaFramework\Exception
Throws \com\setasign\SetaSite\BlockManager\BlockFinalException
Throws \com\setasign\SetaSite\BlockManager\UnknownBlockException
saveRenderData()
Saves the blocks, the renderData and the blocksActualFlag without creating a change!
Parameters
- $page : Page
Exceptions
Throws \com\setasign\SetaSite\PropertyContainer\InvalidValueException
Throws UnknownPageException
Throws \com\setasign\SetaFramework\Exception
Throws \com\setasign\SetaSite\BlockManager\BlockFinalException
Throws \com\setasign\SetaSite\BlockManager\UnknownBlockException
updatePath()
string $oldPath,
string $newPath,
?string $language = null
Parameters
- $version : int
- $oldPath : string
- $newPath : string
- $language : ?string
