You are here

ImageEffectPluginCollection.php in Zircon Profile 8

Same filename and directory in other branches
  1. 8.0 core/modules/image/src/ImageEffectPluginCollection.php

Namespace

Drupal\image

File

core/modules/image/src/ImageEffectPluginCollection.php
View source
<?php

/**
 * @file
 * Contains \Drupal\image\ImageEffectPluginCollection.
 */
namespace Drupal\image;

use Drupal\Core\Plugin\DefaultLazyPluginCollection;

/**
 * A collection of image effects.
 */
class ImageEffectPluginCollection extends DefaultLazyPluginCollection {

  /**
   * {@inheritdoc}
   *
   * @return \Drupal\image\ImageEffectInterface
   */
  public function &get($instance_id) {
    return parent::get($instance_id);
  }

  /**
   * {@inheritdoc}
   */
  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;
  }

}

Classes

Namesort descending Description
ImageEffectPluginCollection A collection of image effects.