You are here

public function Image::updateFormSubmit in SimpleAds 8

Update an ad.

Overrides SimpleAdsTypeBase::updateFormSubmit

File

src/Plugin/SimpleAds/Type/Image.php, line 54

Class

Image
Image Ad type.

Namespace

Drupal\simpleads\Plugin\SimpleAds\Type

Code

public function updateFormSubmit($options, FormStateInterface $form_state, $type = NULL, $id = NULL) {
  if ($fid = reset($form_state
    ->getValue('image'))) {
    if ($options['fid'] != $fid) {
      $options['fid'] = $this
        ->saveImage($fid);
    }
  }
  return $options;
}