Neuron-PHP

IPageRepository

Page repository interface.

Table of Contents

Methods

all()  : array<string|int, Page>
Get all pages
count()  : int
Count total pages
create()  : Page
Create a new page
delete()  : bool
Delete a page
findById()  : Page|null
Find page by ID
findBySlug()  : Page|null
Find page by slug
getByAuthor()  : array<string|int, Page>
Get pages by author
getDrafts()  : array<string|int, Page>
Get draft pages
getPublished()  : array<string|int, Page>
Get published pages
incrementViewCount()  : bool
Increment page view count
update()  : bool
Update an existing page

Methods

all()

Get all pages

public all([string|null $status = null ][, int $limit = 0 ][, int $offset = 0 ]) : array<string|int, Page>
Parameters
$status : string|null = null

Filter by status (null for all)

$limit : int = 0

Maximum number of pages (0 for no limit)

$offset : int = 0

Offset for pagination

Return values
array<string|int, Page>

count()

Count total pages

public count([string|null $status = null ]) : int
Parameters
$status : string|null = null

Filter by status (null for all)

Return values
int

delete()

Delete a page

public delete(int $id) : bool
Parameters
$id : int

Page ID

Return values
bool

True if deleted, false otherwise

findById()

Find page by ID

public findById(int $id) : Page|null
Parameters
$id : int

Page ID

Return values
Page|null

findBySlug()

Find page by slug

public findBySlug(string $slug) : Page|null
Parameters
$slug : string

Page slug

Return values
Page|null

getByAuthor()

Get pages by author

public getByAuthor(int $authorId[, string|null $status = null ]) : array<string|int, Page>
Parameters
$authorId : int

Author user ID

$status : string|null = null

Filter by status (null for all)

Return values
array<string|int, Page>

getDrafts()

Get draft pages

public getDrafts() : array<string|int, Page>
Return values
array<string|int, Page>

getPublished()

Get published pages

public getPublished([int $limit = 0 ][, int $offset = 0 ]) : array<string|int, Page>
Parameters
$limit : int = 0

Maximum number of pages (0 for no limit)

$offset : int = 0

Offset for pagination

Return values
array<string|int, Page>

incrementViewCount()

Increment page view count

public incrementViewCount(int $id) : bool
Parameters
$id : int

Page ID

Return values
bool

True if updated, false otherwise

update()

Update an existing page

public update(Page $page) : bool
Parameters
$page : Page

Page to update

Return values
bool

True if updated, false otherwise


        
On this page

Search results