Neuron-PHP

ITagRepository

Tag repository interface.

Table of Contents

Methods

all()  : array<string|int, Tag>
Get all tags
allWithPostCount()  : array<string|int, mixed>
Get tags with post count
count()  : int
Count total tags
create()  : Tag
Create a new tag
delete()  : bool
Delete a tag
findById()  : Tag|null
Find tag by ID
findByName()  : Tag|null
Find tag by name
findBySlug()  : Tag|null
Find tag by slug
update()  : bool
Update an existing tag

Methods

allWithPostCount()

Get tags with post count

public allWithPostCount() : array<string|int, mixed>
Return values
array<string|int, mixed>

Array of ['tag' => Tag, 'post_count' => int]

delete()

Delete a tag

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

findById()

Find tag by ID

public findById(int $id) : Tag|null
Parameters
$id : int
Return values
Tag|null

findByName()

Find tag by name

public findByName(string $name) : Tag|null
Parameters
$name : string
Return values
Tag|null

findBySlug()

Find tag by slug

public findBySlug(string $slug) : Tag|null
Parameters
$slug : string
Return values
Tag|null

update()

Update an existing tag

public update(Tag $tag) : bool
Parameters
$tag : Tag
Return values
bool

        
On this page

Search results