ImageEffectPluginCollection.php 716 Bytes
Newer Older
1 2 3 4
<?php

/**
 * @file
5
 * Contains \Drupal\image\ImageEffectPluginCollection.
6 7 8 9
 */

namespace Drupal\image;

10
use Drupal\Core\Plugin\DefaultLazyPluginCollection;
11 12 13 14

/**
 * A collection of image effects.
 */
15
class ImageEffectPluginCollection extends DefaultLazyPluginCollection {
16 17 18 19

  /**
   * {@inheritdoc}
   *
20
   * @return \Drupal\image\ImageEffectInterface
21
   */
22 23
  public function &get($instance_id) {
    return parent::get($instance_id);
24 25 26
  }

  /**
27
   * {@inheritdoc}
28
   */
29 30 31 32 33 34 35 36
  public function sortHelper($aID, $bID) {
    $a_weight = $this->get($aID)->getWeight();
    $b_weight = $this->get($bID)->getWeight();
    if ($a_weight == $b_weight) {
      return 0;
    }

    return ($a_weight < $b_weight) ? -1 : 1;
37 38 39
  }

}