BoothItemRepositoryWp
in package
implements
BoothItemRepository
Table of Contents
Interfaces
- BoothItemRepository
- Repository interface for BoothItem aggregates.
Methods
- findByBoothId() : array<int, BoothItem>
- Find booth items belonging to a booth.
- findById() : BoothItem|null
- Find a booth item by its identifier.
- getBoothItemIdByPostId() : BoothItemId|null
- Resolve a BoothItemId from a WordPress post ID.
- save() : void
- Persist changes for a BoothItem aggregate.
- searchByBoothItems() : BoothItemSearchresult
- Search booth items for a given booth.
- searchByCriteria() : BoothItemSearchresult
- Search booth items respecting topics/query and optional booth filter.
- createDateOrNull() : DateTimeImmutable|null
- Helper for date fields.
- findPostIdByBoothItemId() : int|null
- Map BoothItemId to WordPress post ID.
- mapDomainStatusToWp() : string
- Map domain status to a WordPress post_status value.
- mapPost() : BoothItem
- Map a WordPress post to a BoothItem aggregate.
- mapPostIdToBoothItemId() : BoothItemId
- Map post ID to BoothItemId value object.
Methods
findByBoothId()
Find booth items belonging to a booth.
public
findByBoothId(BoothId $boothId) : array<int, BoothItem>
Parameters
- $boothId : BoothId
-
Booth identifier.
Return values
array<int, BoothItem>findById()
Find a booth item by its identifier.
public
findById(BoothItemId $id) : BoothItem|null
Parameters
- $id : BoothItemId
-
Booth item identifier.
Return values
BoothItem|nullgetBoothItemIdByPostId()
Resolve a BoothItemId from a WordPress post ID.
public
getBoothItemIdByPostId(int $postId) : BoothItemId|null
Parameters
- $postId : int
-
WordPress post ID.
Return values
BoothItemId|nullsave()
Persist changes for a BoothItem aggregate.
public
save(BoothItem $boothItem) : void
Parameters
- $boothItem : BoothItem
-
Booth item aggregate.
searchByBoothItems()
Search booth items for a given booth.
public
searchByBoothItems(BoothId $boothId) : BoothItemSearchresult
Parameters
- $boothId : BoothId
-
Booth identifier.
Return values
BoothItemSearchresultsearchByCriteria()
Search booth items respecting topics/query and optional booth filter.
public
searchByCriteria(BoothSearchCriteria $criteria[, array<string|int, BoothId> $limitToBoothIds = [] ]) : BoothItemSearchresult
Parameters
- $criteria : BoothSearchCriteria
-
Search filters.
- $limitToBoothIds : array<string|int, BoothId> = []
-
Optional booth filter.
Return values
BoothItemSearchresultcreateDateOrNull()
Helper for date fields.
private
createDateOrNull(mixed $value) : DateTimeImmutable|null
Parameters
- $value : mixed
-
Raw date value.
Return values
DateTimeImmutable|nullfindPostIdByBoothItemId()
Map BoothItemId to WordPress post ID.
private
findPostIdByBoothItemId(BoothItemId $id) : int|null
Parameters
- $id : BoothItemId
-
Booth item identifier.
Return values
int|nullmapDomainStatusToWp()
Map domain status to a WordPress post_status value.
private
mapDomainStatusToWp(string $status) : string
Parameters
- $status : string
-
Domain status.
Return values
stringmapPost()
Map a WordPress post to a BoothItem aggregate.
private
mapPost(WP_Post $post) : BoothItem
Parameters
- $post : WP_Post
-
WordPress post.
Return values
BoothItemmapPostIdToBoothItemId()
Map post ID to BoothItemId value object.
private
mapPostIdToBoothItemId(int $postId) : BoothItemId
Parameters
- $postId : int
-
WordPress post ID.