You are here

public function Image::createFormSubmit in SimpleAds 8

Create an ad.

Overrides SimpleAdsTypeBase::createFormSubmit

File

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

Class

Image
Image Ad type.

Namespace

Drupal\simpleads\Plugin\SimpleAds\Type

Code

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