Skip to main content

SubscriptionRepository

\Benecaster\Membership\SubscriptionRepository

Class Premium

Data access for native membership subscription rows — the records behind Built-in Membership, including billing state, Stripe identifiers and the Promote to Bridge grace-period columns.

Every read path returns a row hydrated through the same whitelist, so a subscription array has the same shape and the same types wherever it came from. That matters most where a row is handed to third-party code: the benecaster_promote_grace_cleared and _extended actions pass one straight to listeners.

Methods

Method Visibility Since Description
find_by_id( int $id ): ?array Public Looks up one subscription row by primary key, hydrated through the same whitelist as every other read. Returns null for a non-positive id without querying, and null when no row matches. Exists so the grace-period actions can hand listeners a complete row: PromotionService previously carried its own private five-column query, and a listener given that narrow shape had no way to tell it apart from a full one.

Notes

Only the members relevant to published extension points are documented here. The class carries other internal read and write paths that are not developer surface and may change without notice.