25ee6f2a268d68c94a8276eecc9719066528e726
[yaffs-website] / src / ImageEffectPluginCollection.php
1 <?php
2
3 namespace Drupal\image;
4
5 use Drupal\Core\Plugin\DefaultLazyPluginCollection;
6
7 /**
8  * A collection of image effects.
9  */
10 class ImageEffectPluginCollection extends DefaultLazyPluginCollection {
11
12   /**
13    * {@inheritdoc}
14    *
15    * @return \Drupal\image\ImageEffectInterface
16    */
17   public function &get($instance_id) {
18     return parent::get($instance_id);
19   }
20
21   /**
22    * {@inheritdoc}
23    */
24   public function sortHelper($aID, $bID) {
25     $a_weight = $this->get($aID)->getWeight();
26     $b_weight = $this->get($bID)->getWeight();
27     if ($a_weight == $b_weight) {
28       return 0;
29     }
30
31     return ($a_weight < $b_weight) ? -1 : 1;
32   }
33
34 }