FreeBuyupBackfillQueue
\Benecaster\Membership\FreeBuyupBackfillQueue
The buy-up price rows that have just become free and have not been given away yet. BuyupAutoGrant’s backfill grants only the rows held here, which is what stops an ordinary save of a buy-up from giving a free buy-up to everyone on that period again.
A row is added when its amount changes to 0, or when it is created at 0. It is removed when the backfill has given it away, or when its amount moves off 0 or the row is deleted first. It is kept until a save can create the Stripe Price, so a Stripe failure does not lose it.
Being in the queue is not consent. It means nobody has been given the row yet, not that everyone should be: the backfill still skips each subscriber who has declined the buy-up.
Stored in the non-autoloaded option benecaster_buyup_free_backfill_pending.
Methods
| Method | Visibility | Since | Description |
|---|---|---|---|
pending(): array |
Public | — | The price row IDs waiting to be given away. |
contains( int $price_id ): bool |
Public | — | Whether a price row is waiting. |
enqueue( int $price_id ): void |
Public | — | Adds a row that has just become free. |
remove( int $price_id ): void |
Public | — | Removes a row once it has been given away, or is no longer free. |
Constants
| Name | Value | Description |
|---|---|---|
OPTION |
'benecaster_buyup_free_backfill_pending' |