# content-control/2.0.2/classes/Models/RuleEngine/Group.php

Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks &amp; More, version 2.0.2. 94 lines.

- Page: https://pluginprobe.com/plugins/content-control/2.0.2/code/classes/Models/RuleEngine/Group.php
- Raw: https://pluginprobe.com/plugins/content-control/2.0.2/raw/classes/Models/RuleEngine/Group.php
- Modified: 2023-09-18T01:47: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/content-control/2.0.2/code/classes/Models/RuleEngine/Group.php#L10-L20`.

```php
<?php
/**
 * Rule engine group model.
 *
 * @package ContentControl
 * @subpackage Models
 */

namespace ContentControl\Models\RuleEngine;

/**
 * Handler for condition groups.
 *
 * @package ContentControl
 */
class Group extends Item {

	/**
	 * Group id.
	 *
	 * @var string
	 */
	public $id;

	/**
	 * Group label.
	 *
	 * @var string
	 */
	public $label;

	/**
	 * Group query.
	 *
	 * @var Query
	 */
	public $query;

	/**
	 * Build a group.
	 *
	 * @param array $group Group data.
	 */
	public function __construct( $group ) {
		$group = wp_parse_args( $group, [
			'id'    => '',
			'label' => '',
			'query' => [],
		]);

		$this->id    = $group['id'];
		$this->label = $group['label'];
		$this->query = new Query( $group['query'] );
	}

	/**
	 * Check if this group has JS based rules.
	 *
	 * @return bool
	 */
	public function has_js_rules() {
		return $this->query->has_js_rules();
	}

	/**
	 * Check this groups rules.
	 *
	 * @return bool
	 */
	public function check_rules() {
		return $this->query->check_rules();
	}

	/**
	 * Check this groups rules.
	 *
	 * @return bool
	 */
	public function get_checks() {
		return $this->query->get_checks();
	}

	/**
	 * Return the rule check as an array of information.
	 *
	 * Useful for debugging.
	 *
	 * @return array
	 */
	public function get_check_info() {
		return $this->query->get_check_info();
	}
}

```
