You are here

protected function BatchWatermarkForm::getWatermarksOptions in Media watermark 8

Helper to get Watermarks options array or watermark id.

Parameters

null|string|int $fid: File id.

Return value

array Watermark options.

2 calls to BatchWatermarkForm::getWatermarksOptions()
BatchWatermarkForm::addWatermarks in src/Form/BatchWatermarkForm.php
Batch helper function.
BatchWatermarkForm::buildForm in src/Form/BatchWatermarkForm.php
Define the form used for ContentEntityExample settings.

File

src/Form/BatchWatermarkForm.php, line 44

Class

BatchWatermarkForm
Class BatchWatermarkForm.

Namespace

Drupal\media_watermark\Form

Code

protected function getWatermarksOptions($fid = NULL) {
  $this->watermarksOptions =& drupal_static(__CLASS__ . __FUNCTION__);
  if (!isset($this->watermarksOptions)) {
    $watermarks = MediaWatermark::loadMultiple();
    $this->watermarksOptions = MediaWatermark::prepareNames($watermarks);
  }
  return !empty($this->watermarksOptions[$fid]) ? $this->watermarksOptions[$fid] : $this->watermarksOptions;
}