This repository has been archived on 2025-02-26. You can view files and clone it, but cannot push or open issues or pull requests.
szurubooru/src/Sql/Functors/FunctionFunctors/SqlRandomFunctor.php
Marcin Kurczewski cb489d1eca SQL operator refactor
* Added few new operators that were left hardcoded
* Changed "Operator" to "Functor"
* Better hierarchy - less mess
* Serialized SQL queries should contain fewer braces
2014-02-24 21:38:09 +01:00

16 lines
270 B
PHP

<?php
class SqlRandomFunctor extends SqlFunctionFunctor
{
public function getFunctionName()
{
$config = \Chibi\Registry::getConfig();
return $config->main->dbDriver == 'sqlite'
? 'RANDOM'
: 'RAND';
}
public function getArgumentCount()
{
return 2;
}
}