function _image_update_get_style_with_effects

Loads all effects for an image style.

Parameters

array $style: The image style (array) to retrieve effects for.

Return value

array An array of effects keyed by UUIDs.

See also

image_update_8000()

1 call to _image_update_get_style_with_effects()
image_update_8000 in drupal/core/modules/image/image.install
Convert existing image styles to the new config system.

File

drupal/core/modules/image/image.install, line 120
Install, update and uninstall functions for the image module.

Code

function _image_update_get_style_with_effects(array $style) {

  // Retrieve image effects.
  $effects = array();
  $result = db_select('image_effects', NULL, array(
    'fetch' => PDO::FETCH_ASSOC,
  ))
    ->fields('image_effects')
    ->condition('isid', $style['isid'])
    ->execute();
  foreach ($result as $effect) {
    unset($effect['isid']);
    $effect['data'] = unserialize($effect['data']);

    // Generate a unique image effect ID for the effect.
    $uuid = new Uuid();
    $effect['ieid'] = $uuid
      ->generate();
    $effects[$effect['ieid']] = $effect;
  }
  return $effects;
}