PHP 클래스 Backend\Modules\Pages\Engine\Model

저자: Tijs Verkoyen ([email protected])
저자: Davy Hellemans ([email protected])
저자: Matthias Mullie ([email protected])
저자: Jeroen Desloovere ([email protected])
파일 보기 프로젝트 열기: forkcms/forkcms 1 사용 예제들

공개 메소드들

메소드 설명
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.