You are here

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

Evaluate if current element has required crops set from widget settings.

Parameters

array $element: All form elements without crop properties.

Return value

bool True if 'crop_types_required' settings is set or False.

See also

ImageCrop::cropRequired()

2 calls to ImageCrop::hasCropRequired()
ImageCrop::cropRequired in src/Element/ImageCrop.php
Form element validation handler for crop widget elements.
ImageCrop::isRequiredType in src/Element/ImageCrop.php
Check if given $crop_type is required for current instance or not.

File

src/Element/ImageCrop.php, line 441

Class

ImageCrop
Provides a form element for crop.

Namespace

Drupal\image_widget_crop\Element

Code

public static function hasCropRequired(array $element) {
  return isset($element['#crop_types_required']) || !empty($element['#crop_types_required']);
}