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

Breadcrumb

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

function Constraint::isCompatible

Determines if the provided version is satisfied by this constraint.

Parameters

string $version: The version to check, for example '4.2'.

Return value

bool TRUE if the provided version is satisfied by this constraint, FALSE if not.

File

core/lib/Drupal/Component/Version/Constraint.php, line 64

Class

Constraint
A value object representing a Drupal version constraint.

Namespace

Drupal\Component\Version

Code

public function isCompatible($version) {
    foreach ($this->constraintArray as $constraint) {
        if (!version_compare($version, $constraint['version'], $constraint['op'])) {
            return FALSE;
        }
    }
    return TRUE;
}

API Navigation

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