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

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
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 }