You are here

public function Constraint::toArray in Drupal 8

A list of associative arrays representing the constraint.

Each containing the keys:

  • 'op': can be one of: '=', '==', '!=', '<>', '<', '<=', '>', or '>='.
  • 'version': A complete version, e.g. '4.5-beta3'.

Return value

array[] The constraint represented as an array.

Deprecated

in drupal:8.7.0 and is removed from drupal:9.0.0. Only exists to provide a backwards compatibility layer.

See also

https://www.drupal.org/node/2756875

File

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

Class

Constraint
A value object representing a Drupal version constraint.

Namespace

Drupal\Component\Version

Code

public function toArray() {
  @trigger_error(sprintf('%s() only exists to provide a backwards compatibility layer. See https://www.drupal.org/node/2756875', __METHOD__), E_USER_DEPRECATED);
  return $this->constraintArray;
}