Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. EntityConditionGroup.php

class EntityConditionGroup

A condition group for the EntityQuery.

@internal JSON:API maintains no PHP API since its API is the HTTP API. This class may change at any time and this will break any dependencies on it.

Hierarchy

  • class \Drupal\jsonapi\Query\EntityConditionGroup

Expanded class hierarchy of EntityConditionGroup

See also

https://www.drupal.org/project/drupal/issues/3032787

jsonapi.api.php

1 file declares its use of EntityConditionGroup
TemporaryQueryGuard.php in core/modules/jsonapi/src/Access/TemporaryQueryGuard.php

File

core/modules/jsonapi/src/Query/EntityConditionGroup.php, line 14

Namespace

Drupal\jsonapi\Query
View source
class EntityConditionGroup {
    
    /**
     * The AND conjunction value.
     *
     * @var array
     */
    protected static $allowedConjunctions = [
        'AND',
        'OR',
    ];
    
    /**
     * The conjunction.
     *
     * @var string
     */
    protected $conjunction;
    
    /**
     * The members of the condition group.
     *
     * @var \Drupal\jsonapi\Query\EntityCondition[]
     */
    protected $members;
    
    /**
     * Constructs a new condition group object.
     *
     * @param string $conjunction
     *   The group conjunction to use.
     * @param array $members
     *   (optional) The group conjunction to use.
     */
    public function __construct($conjunction, array $members = []) {
        if (!in_array($conjunction, self::$allowedConjunctions)) {
            throw new \InvalidArgumentException('Allowed conjunctions: AND, OR.');
        }
        $this->conjunction = $conjunction;
        $this->members = $members;
    }
    
    /**
     * The condition group conjunction.
     *
     * @return string
     *   The condition group conjunction.
     */
    public function conjunction() {
        return $this->conjunction;
    }
    
    /**
     * The members which belong to the condition group.
     *
     * @return \Drupal\jsonapi\Query\EntityCondition[]
     *   The member conditions of this condition group.
     */
    public function members() {
        return $this->members;
    }

}

Members

Title Sort descending Modifiers Object type Summary
EntityConditionGroup::$allowedConjunctions protected static property The AND conjunction value.
EntityConditionGroup::$conjunction protected property The conjunction.
EntityConditionGroup::$members protected property The members of the condition group.
EntityConditionGroup::conjunction public function The condition group conjunction.
EntityConditionGroup::members public function The members which belong to the condition group.
EntityConditionGroup::__construct public function Constructs a new condition group object.

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal