# give/4.16.8.1/src/Subscriptions/ValueObjects/SubscriptionPeriod.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.16.8.1. 57 lines.

- Page: https://pluginprobe.com/plugins/give/4.16.8.1/code/src/Subscriptions/ValueObjects/SubscriptionPeriod.php
- Raw: https://pluginprobe.com/plugins/give/4.16.8.1/raw/src/Subscriptions/ValueObjects/SubscriptionPeriod.php
- Modified: 2023-01-18T19:19:38+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/4.16.8.1/code/src/Subscriptions/ValueObjects/SubscriptionPeriod.php#L10-L20`.

```php
<?php

namespace Give\Subscriptions\ValueObjects;


use Give\Framework\Support\ValueObjects\Enum;

/**
 * @since 2.19.6
 *
 * @method static SubscriptionPeriod DAY()
 * @method static SubscriptionPeriod WEEK()
 * @method static SubscriptionPeriod MONTH()
 * @method static SubscriptionPeriod QUARTER()
 * @method static SubscriptionPeriod YEAR()
 * @method bool isDay
 * @method bool isWeek
 * @method bool isMonth
 * @method bool isQuarter
 * @method bool isYear
 */
class SubscriptionPeriod extends Enum {
    const DAY = 'day';
    const WEEK = 'week';
    const QUARTER = 'quarter';
    const MONTH = 'month';
    const YEAR = 'year';

    /**
     * @since 2.24.0
     *
     * @return array
     */
    public static function labels(): array
    {
        return [
            self::DAY => [__( 'Daily', 'give' ), __( 'Every %d days', 'give' )],
            self::WEEK => [__( 'Weekly', 'give' ), __( 'Every %d weeks', 'give' )],
            self::QUARTER => [__( 'Quarterly', 'give' ), __( 'Every %d quarters', 'give' )],
            self::MONTH => [__( 'Monthly', 'give' ), __( 'Every %d months', 'give' )],
            self::YEAR => [__( 'Yearly', 'give' ), __( 'Every %d years', 'give' )],
        ];
    }

    /**
     * @since 2.24.0
     *
     * @param int $frequency
     *
     * @return string
     */
    public function label(int $frequency): string
    {
        return self::labels()[ $this->getValue() ][$frequency > 1];
    }
}

```
