Documentation

pm_Hook_Limits
in package
implements pm_Hook_Interface

Hook for registering limits

Tags
since
17.0

Interfaces, Classes and Traits

pm_Hook_Interface
Generic interface for hooks

Table of Contents

PLACE_ADDITIONAL  = 'additional'
PLACE_MAIN  = 'main'
getLimits()  : array<string|int, mixed>
Retrieve the list of limits

Constants

PLACE_ADDITIONAL

public mixed PLACE_ADDITIONAL = 'additional'

PLACE_MAIN

public mixed PLACE_MAIN = 'main'

Methods

getLimits()

Retrieve the list of limits

public abstract getLimits() : array<string|int, mixed>
[
    'unique_limit_id' => [
        'default' => false,
        'place' => self::PLACE_MAIN,
        'name' => 'Limit name',
        'description' => 'Limit description',
    ],
    ...
]

Note: use only 0 or -1 as default values for numeric limits. Otherwise, the default limit for both reseller plan and subscription will be the same. If a reseller has more than one subscription, it will be impossible to synchronize plan changes with not allowed overselling, because the default value multiplied by the number of subscriptions may exceed the reseller's default limit, which can be confusing for users.

Return values
array<string|int, mixed>

Search results