PHP Класс Backend\Modules\Pages\Engine\Model

Автор: Tijs Verkoyen ([email protected])
Автор: Davy Hellemans ([email protected])
Автор: Matthias Mullie ([email protected])
Автор: Jeroen Desloovere ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
buildCache ( string $language = null ) Build the cache
copy ( string $from, string $to ) Copy pages
createHtml ( string $type = 'page', integer $depth, integer $parentId = 1, string $html = '' ) : string Creates the html for the menu
delete ( integer $id, string $language = null, integer $revisionId = null ) : boolean Delete a page
exists ( integer $id ) : boolean Check if a page exists
get ( integer $id, integer $revisionId = null, string $language = null ) : mixed Get the data for a record
getBlocks ( integer $id, integer $revisionId = null, string $language = null ) : array Get blocks for a certain page/revision
getByTag ( integer $tagId ) : array Get all items by a given tag id
getCacheBuilder ( ) : CacheBuilder
getEncodedRedirectURL ( string $redirectURL ) : string Get encoded redirect URL
getFirstChildId ( integer $pageId ) : mixed Get the first child for a given parent
getFullURL ( integer $id ) : string Get the full-URL for a given menuId
getLatestRevision ( integer $id, string $language = null ) : integer Get latest revision id for a page.
getMaximumBlockId ( ) : integer Get the maximum unique id for blocks
getMaximumPageId ( string $language = null ) : integer Get the maximum unique id for pages
getMaximumSequence ( integer $parentId, string $language = null ) : integer Get the maximum sequence inside a leaf
getPagesForDropdown ( string $language = null ) : array Get the pages for usage in a dropdown menu
getSubtree ( array $navigation, integer $parentId ) : string Get the subtree for a root element
getTree ( array $ids, array $data = null, integer $level = 1, string $language = null ) : array Get all pages/level
getTreeHTML ( ) : string Get the tree
getTypes ( ) : array Get the possible block types
getURL ( string $url, integer $id = null, integer $parentId, boolean $isAction = false ) : string Get an unique URL for a page
insert ( array $page ) : integer Insert a page
insertBlocks ( array $blocks ) Insert multiple blocks at once
move ( integer $id, integer $droppedOn, string $typeOfDrop, string $tree, string $language = null ) : boolean Move a page
update ( array $page ) : integer Update a page
updatePagesTemplates ( integer $oldTemplateId, integer $newTemplateId, boolean $overwrite = false ) Switch templates for all existing pages

Описание методов

buildCache() публичный статический Метод

Build the cache
public static buildCache ( string $language = null )
$language string The language to build the cache for, if not passed we use the working language.

copy() публичный статический Метод

Copy pages
public static copy ( string $from, string $to )
$from string The language code to copy the pages from.
$to string The language code we want to copy the pages to.

createHtml() публичный статический Метод

Creates the html for the menu
public static createHtml ( string $type = 'page', integer $depth, integer $parentId = 1, string $html = '' ) : string
$type string The type of navigation.
$depth integer The maximum depth to show.
$parentId integer The Id to start from.
$html string Will hold the created HTML.
Результат string

delete() публичный статический Метод

Delete a page
public static delete ( integer $id, string $language = null, integer $revisionId = null ) : boolean
$id integer The id of the page to delete.
$language string The language wherein the page will be deleted, if not provided we will use the working language.
$revisionId integer If specified the given revision will be deleted, used for deleting drafts.
Результат boolean

exists() публичный статический Метод

Check if a page exists
public static exists ( integer $id ) : boolean
$id integer The id to check for existence.
Результат boolean

get() публичный статический Метод

Get the data for a record
public static get ( integer $id, integer $revisionId = null, string $language = null ) : mixed
$id integer The Id of the page to fetch.
$revisionId integer
$language string The language to use while fetching the page.
Результат mixed False if the record can't be found, otherwise an array with all data.

getBlocks() публичный статический Метод

Get blocks for a certain page/revision
public static getBlocks ( integer $id, integer $revisionId = null, string $language = null ) : array
$id integer The id of the page.
$revisionId integer The revision to grab.
$language string The language to use.
Результат array

getByTag() публичный статический Метод

Get all items by a given tag id
public static getByTag ( integer $tagId ) : array
$tagId integer The id of the tag.
Результат array

getCacheBuilder() публичный статический Метод

public static getCacheBuilder ( ) : CacheBuilder
Результат CacheBuilder

getEncodedRedirectURL() публичный статический Метод

Get encoded redirect URL
public static getEncodedRedirectURL ( string $redirectURL ) : string
$redirectURL string
Результат string

getFirstChildId() публичный статический Метод

Get the first child for a given parent
public static getFirstChildId ( integer $pageId ) : mixed
$pageId integer The Id of the page to get the first child for.
Результат mixed

getFullURL() публичный статический Метод

Get the full-URL for a given menuId
public static getFullURL ( integer $id ) : string
$id integer The Id of the page to get the URL for.
Результат string

getLatestRevision() публичный статический Метод

Get latest revision id for a page.
public static getLatestRevision ( integer $id, string $language = null ) : integer
$id integer The id of the page.
$language string The language to use.
Результат integer

getMaximumBlockId() публичный статический Метод

Get the maximum unique id for blocks
public static getMaximumBlockId ( ) : integer
Результат integer

getMaximumPageId() публичный статический Метод

Get the maximum unique id for pages
public static getMaximumPageId ( string $language = null ) : integer
$language string The language to use, if not provided we will use the working language.
Результат integer

getMaximumSequence() публичный статический Метод

Get the maximum sequence inside a leaf
public static getMaximumSequence ( integer $parentId, string $language = null ) : integer
$parentId integer The Id of the parent.
$language string The language to use, if not provided we will use the working language.
Результат integer

getPagesForDropdown() публичный статический Метод

Get the pages for usage in a dropdown menu
public static getPagesForDropdown ( string $language = null ) : array
$language string The language to use, if not provided we will use the working language.
Результат array

getSubtree() публичный статический Метод

Get the subtree for a root element
public static getSubtree ( array $navigation, integer $parentId ) : string
$navigation array The navigation array.
$parentId integer The id of the parent.
Результат string

getTree() публичный статический Метод

Get all pages/level
public static getTree ( array $ids, array $data = null, integer $level = 1, string $language = null ) : array
$ids array The parentIds.
$data array A holder for the generated data.
$level integer The counter for the level.
$language string The language.
Результат array

getTreeHTML() публичный статический Метод

Get the tree
public static getTreeHTML ( ) : string
Результат string

getTypes() публичный статический Метод

Get the possible block types
public static getTypes ( ) : array
Результат array

getURL() публичный статический Метод

Get an unique URL for a page
public static getURL ( string $url, integer $id = null, integer $parentId, boolean $isAction = false ) : string
$url string The URL to base on.
$id integer The id to ignore.
$parentId integer The parent for the page to create an url for.
$isAction boolean Is this page an action.
Результат string

insert() публичный статический Метод

Insert a page
public static insert ( array $page ) : integer
$page array The data for the page.
Результат integer

insertBlocks() публичный статический Метод

Insert multiple blocks at once
public static insertBlocks ( array $blocks )
$blocks array The blocks to insert.

move() публичный статический Метод

Move a page
public static move ( integer $id, integer $droppedOn, string $typeOfDrop, string $tree, string $language = null ) : boolean
$id integer The id for the page that has to be moved.
$droppedOn integer The id for the page where to page has been dropped on.
$typeOfDrop string The type of drop, possible values are: before, after, inside.
$tree string The tree the item is dropped on, possible values are: main, meta, footer, root.
$language string The language to use, if not provided we will use the working language.
Результат boolean

update() публичный статический Метод

Update a page
public static update ( array $page ) : integer
$page array The new data for the page.
Результат integer

updatePagesTemplates() публичный статический Метод

Switch templates for all existing pages
public static updatePagesTemplates ( integer $oldTemplateId, integer $newTemplateId, boolean $overwrite = false )
$oldTemplateId integer The id of the new template to replace.
$newTemplateId integer The id of the new template to use.
$overwrite boolean Overwrite all pages with default blocks.