Add hasVersion function (ofaj)

pull/2487/head
jmontoyaa 8 years ago
parent 41803607d2
commit 7819c14c5e
  1. 25
      main/inc/lib/legal.lib.php

@ -115,6 +115,31 @@ class LegalManager
return $result;
}
/**
* @param int $language
* @param string $version
*
* @return bool
*/
public static function hasVersion($language, $version)
{
$table = Database::get_main_table(TABLE_MAIN_LEGAL);
$language = intval($language);
$version = Database::escape_string($version);
$sql = "SELECT version FROM $table
WHERE
language_id = '$language' AND
version = '$version'
LIMIT 1 ";
$result = Database::query($sql);
if (Database::num_rows($result) > 0) {
return true;
} else {
return false;
}
}
/**
* @param string $content
* @return string

Loading…
Cancel
Save