function VersionNegotiator::addVersionNegotiator
Same name in other branches
- 9 core/modules/jsonapi/src/Revisions/VersionNegotiator.php \Drupal\jsonapi\Revisions\VersionNegotiator::addVersionNegotiator()
- 10 core/modules/jsonapi/src/Revisions/VersionNegotiator.php \Drupal\jsonapi\Revisions\VersionNegotiator::addVersionNegotiator()
- 11.x core/modules/jsonapi/src/Revisions/VersionNegotiator.php \Drupal\jsonapi\Revisions\VersionNegotiator::addVersionNegotiator()
Adds a version negotiator.
Parameters
\Drupal\jsonapi\Revisions\VersionNegotiatorInterface $version_negotiator: The version negotiator.
string $negotiator_name: The name of the negotiation strategy used by the version negotiator.
File
-
core/
modules/ jsonapi/ src/ Revisions/ VersionNegotiator.php, line 45
Class
- VersionNegotiator
- Provides a version negotiator manager.
Namespace
Drupal\jsonapi\RevisionsCode
public function addVersionNegotiator(VersionNegotiatorInterface $version_negotiator, $negotiator_name) {
assert(strpos(get_class($version_negotiator), 'Drupal\\jsonapi\\') === 0, 'Version negotiators are not a public API.');
$this->negotiators[$negotiator_name] = $version_negotiator;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.