Prado\I18N\core\MessageSource_MySQL::isValidSource PHP Method

isValidSource() protected method

Check if a particular catalogue+variant exists in the database.
protected isValidSource ( $variant ) : boolean
return boolean true if the catalogue+variant is in the database, false otherwise.
    protected function isValidSource($variant)
    {
        $variant = mysql_real_escape_string($variant);
        $rs = mysql_query("SELECT COUNT(*) FROM catalogue WHERE name = '{$variant}'", $this->db);
        $row = mysql_fetch_array($rs, MYSQL_NUM);
        $result = $row && $row[0] == '1';
        return $result;
    }