comparison core/modules/image/src/ImageEffectPluginCollection.php @ 0:c75dbcec494b

Initial commit from drush-created site
author Chris Cannam
date Thu, 05 Jul 2018 14:24:15 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:c75dbcec494b
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 }