5 * Contains \Drupal\linkit\MatcherCollection.
8 namespace Drupal\linkit;
10 use Drupal\Core\Plugin\DefaultLazyPluginCollection;
13 * A collection of matchers.
15 class MatcherCollection extends DefaultLazyPluginCollection {
18 * All possible matcher IDs.
22 protected $definitions;
27 * @return \Drupal\linkit\MatcherInterface
29 public function &get($instance_id) {
30 return parent::get($instance_id);
36 public function sortHelper($aID, $bID) {
37 $a_weight = $this->get($aID)->getWeight();
38 $b_weight = $this->get($bID)->getWeight();
39 if ($a_weight == $b_weight) {
40 return strnatcasecmp($this->get($aID)->getLabel(), $this->get($bID)->getLabel());
43 return ($a_weight < $b_weight) ? -1 : 1;