Prado\I18N\core\MessageSource_SQLite::isValidSource PHP Méthode

isValidSource() protected méthode

Check if a particular catalogue+variant exists in the database.
protected isValidSource ( $variant ) : boolean
Résultat boolean true if the catalogue+variant is in the database, false otherwise.
    protected function isValidSource($variant)
    {
        $variant = sqlite_escape_string($variant);
        $db = sqlite_open($this->source);
        $rs = sqlite_query("SELECT COUNT(*) FROM catalogue WHERE name = '{$variant}'", $db);
        $result = $rs && (int) sqlite_fetch_single($rs);
        sqlite_close($db);
        return $result;
    }