You are here

function media_watermark_get_watermarks in Media watermark 7

Function to get all watermarks array stored in db.

Return value

array|null all stored watermarks

1 call to media_watermark_get_watermarks()
media_watermark_form_alter in ./media_watermark.module
Implements hook_form_alter().

File

./media_watermark.module, line 76
Watermark media module.

Code

function media_watermark_get_watermarks() {
  $result = db_query("SELECT * FROM {media_watermark}");
  if (isset($result) && !empty($result)) {
    $watermarks = $result
      ->fetchAll(PDO::FETCH_ASSOC);

    // Clean values.
    foreach ($watermarks as &$watermark) {
      $watermark = array_map('check_plain', $watermark);
    }
    return $watermarks;
  }
}