Application
Interfaces, Classes, Traits and Enums
Table of Contents
- db_paywall_cb() : mixed
- load_subscriptions() : array<string|int, mixed>
- Takes an array of subscription post_ids and instantiates them into an array of Subscription objects.
- get_subscription_ids() : array<string|int, mixed>
- paywall_interval_text() : string
- Convert a duration in seconds to human readable.
- get_sub_transaction_ids_by_tag_after_time() : array<string|int, mixed>
- Gets subscription transactions with a specific currency, tag, and created after a specific timestamp.
Functions
db_paywall_cb()
db_paywall_cb() : mixed
Return values
mixed —load_subscriptions()
Takes an array of subscription post_ids and instantiates them into an array of Subscription objects.
load_subscriptions(array<string|int, mixed> $post_ids) : array<string|int, mixed>
If a subscription cannot be loaded due to Subscription::load() throwing (i.e. bad DB data), then the error will be logged and the rest of the subscriptions will be loaded.
Parameters
- $post_ids : array<string|int, mixed>
-
The array of integer post_ids
Return values
array<string|int, mixed> —The array of Subscription objects.
get_subscription_ids()
get_subscription_ids() : array<string|int, mixed>
Return values
array<string|int, mixed> —paywall_interval_text()
Convert a duration in seconds to human readable.
paywall_interval_text(int $seconds[, int $detail = 2 ]) : string
Parameters
- $seconds : int
-
The duration.
- $detail : int = 2
-
How many non-zero units to display, starting to count from larger units first. 0 means show all.
Return values
string —The human-readable text, ready to display.
get_sub_transaction_ids_by_tag_after_time()
Gets subscription transactions with a specific currency, tag, and created after a specific timestamp.
get_sub_transaction_ids_by_tag_after_time(int $sub_id, string $after) : array<string|int, mixed>
Useful for the admin dashboard stats.
Parameters
- $sub_id : int
- $after : string
-
Example: -1 days, -7 days, -1 months.
Return values
array<string|int, mixed> —The transactions found.