You are here

public static function ImageCrop::isRequiredType in Image Widget Crop 8.2

Check if given $crop_type is required for current instance or not.

Parameters

array $element: All form elements.

string $crop_type_id: The id of the current crop.

Return value

string Return string "1" if given crop is required or "0".

1 call to ImageCrop::isRequiredType()
ImageCrop::processCrop in src/Element/ImageCrop.php
Render API callback: Expands the image_crop element type.

File

src/Element/ImageCrop.php, line 270

Class

ImageCrop
Provides a form element for crop.

Namespace

Drupal\image_widget_crop\Element

Code

public static function isRequiredType(array $element, $crop_type_id) {
  return (string) (static::hasCropRequired($element) && in_array($crop_type_id, $element['#crop_types_required']) ?: FALSE);
}