This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
drupalcampbristol/web/core/modules/image/src/ImageEffectPluginCollection.php
2017-02-13 15:31:17 +00:00

35 lines
643 B
PHP

<?php
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;
}
}