You are here

public static function Crop::getCropFromImageStyle in Crop API 8.2

Same name and namespace in other branches
  1. 8 src/Entity/Crop.php \Drupal\crop\Entity\Crop::getCropFromImageStyle()

Retrieve crop from given image style.

Parameters

string $uri: URI of the image.

\Drupal\image\ImageStyleInterface $image_style: The image style.

Return value

\Drupal\crop\CropInterface|null Crop entity used by effect 'crop_crop' or NULL if crop doesn't exist.

Overrides CropInterface::getCropFromImageStyle

Deprecated

use getCropFromImageStyleId instead.

File

src/Entity/Crop.php, line 152

Class

Crop
Defines the crop entity class.

Namespace

Drupal\crop\Entity

Code

public static function getCropFromImageStyle($uri, ImageStyleInterface $image_style) {
  @trigger_error('Crop::getCropFromImageStyle() is deprecated, use Crop::getCropFromImageStyleId() instead.', E_USER_DEPRECATED);
  return static::getCropFromImageStyleId($uri, $image_style
    ->id());
}