TopicRepositoryWp
in package
implements
TopicRepository
Table of Contents
Interfaces
- TopicRepository
- Repository interface for topics.
Constants
- TAXONOMY = 'webviep_topic'
Methods
- all() : array<int, Topic>
- Return all topics.
- create() : Topic
- Create a new topic term from the domain entity.
- findById() : Topic|null
- Find a topic by its identifier.
- update() : Topic
- Update an existing topic term (or create if missing).
- mapTerm() : Topic|null
- Map a WordPress term to a domain Topic.
Constants
TAXONOMY
private
mixed
TAXONOMY
= 'webviep_topic'
Methods
all()
Return all topics.
public
all() : array<int, Topic>
Return values
array<int, Topic>create()
Create a new topic term from the domain entity.
public
create(Topic $topic) : Topic
Parameters
- $topic : Topic
-
Topic aggregate.
Return values
TopicfindById()
Find a topic by its identifier.
public
findById(TopicId $id) : Topic|null
Parameters
- $id : TopicId
-
Topic identifier.
Return values
Topic|nullupdate()
Update an existing topic term (or create if missing).
public
update(Topic $topic) : Topic
Parameters
- $topic : Topic
-
Topic aggregate.
Return values
TopicmapTerm()
Map a WordPress term to a domain Topic.
private
mapTerm(WP_Term $term) : Topic|null
Parameters
- $term : WP_Term
-
WordPress term.