# double-opt-in/5.13.1/src/Subscription/SubscriptionGroupResolverInterface.php

Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification, version 5.13.1. 47 lines.

- Page: https://pluginprobe.com/plugins/double-opt-in/5.13.1/code/src/Subscription/SubscriptionGroupResolverInterface.php
- Raw: https://pluginprobe.com/plugins/double-opt-in/5.13.1/raw/src/Subscription/SubscriptionGroupResolverInterface.php
- Modified: 2026-10-08T08:30:10+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/double-opt-in/5.13.1/code/src/Subscription/SubscriptionGroupResolverInterface.php#L10-L20`.

```php
<?php
/**
 * Contract between the core and an add-on that manages subscription groups.
 *
 * @package Forge12\DoubleOptIn\Subscription
 * @since   5.12.0
 */

declare( strict_types=1 );

namespace Forge12\DoubleOptIn\Subscription;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * @api
 *
 * Consumers (admin list, opt-out page, export, analytics) only ever talk to
 * this interface, never to the add-on that implements it. Without an
 * add-on the {@see NullSubscriptionGroupResolver} answers "no groups" and
 * every consumer behaves exactly as before.
 */
interface SubscriptionGroupResolverInterface {

	/**
	 * The group a record belongs to, or null when it is in none.
	 *
	 * @param int    $formId  The record's form id.
	 * @param string $formRef The record's form instance reference, if any.
	 */
	public function groupForForm( int $formId, string $formRef = '' ): ?SubscriptionGroup;

	/**
	 * A group by its key, or null when it does not exist.
	 */
	public function findGroup( string $key ): ?SubscriptionGroup;

	/**
	 * All groups, for selection lists.
	 *
	 * @return SubscriptionGroup[]
	 */
	public function groups(): array;
}

```
