Heratio Framework API Reference

LandingPageRepository
in package

Landing Page Repository

Handles database operations for landing pages and blocks

Table of Contents

Methods

createBlock()  : int
Create new block
createPage()  : int
Create new landing page
createVersion()  : int
Create page version snapshot
deleteBlock()  : bool
Delete block
deletePage()  : bool
Delete landing page
duplicateBlock()  : int|null
Duplicate block
getAllBlockTypes()  : Collection
Get all block types
getAllPages()  : Collection
Get all landing pages
getAuditLog()  : Collection
Get audit log
getBlockById()  : object|null
Get block by ID
getBlockTypeById()  : object|null
Get block type by ID
getBlockTypeByName()  : object|null
Get block type by machine name
getChildBlocks()  : Collection
Get child blocks for a parent block
getDefaultPage()  : object|null
Get default landing page
getPageBlocks()  : Collection
Get all blocks for a page
getPageById()  : object|null
Get page by ID
getPageBySlug()  : object|null
Get page by slug
getPageVersions()  : Collection
Get page versions
logAudit()  : void
Log audit entry
moveBlockToColumn()  : bool
Move block into a column
reorderBlocks()  : bool
Reorder blocks on a page
reorderColumnBlocks()  : bool
Reorder blocks within a column
restoreVersion()  : bool
Restore version
slugExists()  : bool
Check if slug exists
updateBlock()  : bool
Update block
updatePage()  : bool
Update landing page

Methods

createBlock()

Create new block

public createBlock(array<string|int, mixed> $data) : int
Parameters
$data : array<string|int, mixed>
Return values
int

createPage()

Create new landing page

public createPage(array<string|int, mixed> $data) : int
Parameters
$data : array<string|int, mixed>
Return values
int

createVersion()

Create page version snapshot

public createVersion(int $pageId[, string $status = 'draft' ][, int|null $userId = null ][, string|null $notes = null ]) : int
Parameters
$pageId : int
$status : string = 'draft'
$userId : int|null = null
$notes : string|null = null
Return values
int

deleteBlock()

Delete block

public deleteBlock(int $id) : bool
Parameters
$id : int
Return values
bool

deletePage()

Delete landing page

public deletePage(int $id) : bool
Parameters
$id : int
Return values
bool

duplicateBlock()

Duplicate block

public duplicateBlock(int $blockId) : int|null
Parameters
$blockId : int
Return values
int|null

getAllBlockTypes()

Get all block types

public getAllBlockTypes([bool $activeOnly = true ]) : Collection
Parameters
$activeOnly : bool = true
Return values
Collection

getAllPages()

Get all landing pages

public getAllPages([bool $activeOnly = false ]) : Collection
Parameters
$activeOnly : bool = false
Return values
Collection

getAuditLog()

Get audit log

public getAuditLog([int|null $pageId = null ][, int $limit = 50 ]) : Collection
Parameters
$pageId : int|null = null
$limit : int = 50
Return values
Collection

getBlockById()

Get block by ID

public getBlockById(int $id) : object|null
Parameters
$id : int
Return values
object|null

getBlockTypeById()

Get block type by ID

public getBlockTypeById(int $id) : object|null
Parameters
$id : int
Return values
object|null

getBlockTypeByName()

Get block type by machine name

public getBlockTypeByName(string $machineName) : object|null
Parameters
$machineName : string
Return values
object|null

getChildBlocks()

Get child blocks for a parent block

public getChildBlocks(int $parentBlockId) : Collection
Parameters
$parentBlockId : int
Return values
Collection

getDefaultPage()

Get default landing page

public getDefaultPage() : object|null
Return values
object|null

getPageBlocks()

Get all blocks for a page

public getPageBlocks(int $pageId[, bool $visibleOnly = false ]) : Collection
Parameters
$pageId : int
$visibleOnly : bool = false
Return values
Collection

getPageById()

Get page by ID

public getPageById(int $id) : object|null
Parameters
$id : int
Return values
object|null

getPageBySlug()

Get page by slug

public getPageBySlug(string $slug) : object|null
Parameters
$slug : string
Return values
object|null

getPageVersions()

Get page versions

public getPageVersions(int $pageId[, int $limit = 10 ]) : Collection
Parameters
$pageId : int
$limit : int = 10
Return values
Collection

logAudit()

Log audit entry

public logAudit(string $action[, int|null $pageId = null ][, int|null $blockId = null ][, array<string|int, mixed>|null $details = null ][, int|null $userId = null ]) : void
Parameters
$action : string
$pageId : int|null = null
$blockId : int|null = null
$details : array<string|int, mixed>|null = null
$userId : int|null = null

moveBlockToColumn()

Move block into a column

public moveBlockToColumn(int $blockId, int|null $parentBlockId, string|null $columnSlot) : bool
Parameters
$blockId : int
$parentBlockId : int|null
$columnSlot : string|null
Return values
bool

reorderBlocks()

Reorder blocks on a page

public reorderBlocks(int $pageId[, array<string|int, mixed>|null $order = null ]) : bool
Parameters
$pageId : int
$order : array<string|int, mixed>|null = null
Return values
bool

reorderColumnBlocks()

Reorder blocks within a column

public reorderColumnBlocks(int|null $parentBlockId, string|null $columnSlot, array<string|int, mixed> $order) : bool
Parameters
$parentBlockId : int|null
$columnSlot : string|null
$order : array<string|int, mixed>
Return values
bool

restoreVersion()

Restore version

public restoreVersion(int $versionId) : bool
Parameters
$versionId : int
Return values
bool

slugExists()

Check if slug exists

public slugExists(string $slug[, int|null $excludeId = null ]) : bool
Parameters
$slug : string
$excludeId : int|null = null
Return values
bool

updateBlock()

Update block

public updateBlock(int $id, array<string|int, mixed> $data) : bool
Parameters
$id : int
$data : array<string|int, mixed>
Return values
bool

updatePage()

Update landing page

public updatePage(int $id, array<string|int, mixed> $data) : bool
Parameters
$id : int
$data : array<string|int, mixed>
Return values
bool

        
On this page

Search results