* Added few new operators that were left hardcoded * Changed "Operator" to "Functor" * Better hierarchy - less mess * Serialized SQL queries should contain fewer braces
16 lines
270 B
PHP
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;
|
|
}
|
|
}
|