You are here

public function ImageWidgetCropManager::cropHasChanged in Image Widget Crop 8

Same name and namespace in other branches
  1. 8.2 src/ImageWidgetCropManager.php \Drupal\image_widget_crop\ImageWidgetCropManager::cropHasChanged()

Compare crop zone properties when user saved one crop.

Parameters

array $crop_properties: The crop properties after saved the form.

array $old_crop: The crop properties save in this crop entity, Only if this crop already exist.

Return value

bool Return true if properties is not identical.

1 call to ImageWidgetCropManager::cropHasChanged()
ImageWidgetCropManager::updateCrop in src/ImageWidgetCropManager.php
Update old crop with new properties choose in UI.

File

src/ImageWidgetCropManager.php, line 377

Class

ImageWidgetCropManager
ImageWidgetCropManager calculation class.

Namespace

Drupal\image_widget_crop

Code

public function cropHasChanged(array $crop_properties, array $old_crop) {
  if (!empty(array_diff_assoc($crop_properties, $old_crop))) {
    return TRUE;
  }
  return FALSE;
}