20250819
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
use goodboyalex\php_components_pack\classes\Tuple;
|
||||
use goodboyalex\php_components_pack\extensions\StringExtension;
|
||||
use goodboyalex\php_components_pack\interfaces\IArrayable;
|
||||
use goodboyalex\php_db_components_pack\enums\DBDriver;
|
||||
use PHPUnit\Event\InvalidArgumentException;
|
||||
|
||||
/**
|
||||
@@ -101,15 +102,19 @@
|
||||
/**
|
||||
* Формирует условие.
|
||||
*
|
||||
* @param DBDriver $driver Тип драйвера СУБД.
|
||||
* @param int $index Индекс замены параметров для защиты от SQL-инъекций.
|
||||
*
|
||||
* @return Tuple (string, array) Сформированное условие: SQL-запрос и параметры запроса.
|
||||
*/
|
||||
public function Get (int $index = 0): Tuple
|
||||
public function Get (DBDriver $driver, int $index = 0): Tuple
|
||||
{
|
||||
// Получаю знаки открытия и закрытия
|
||||
[$signOpen, $signClose] = $driver->GetSigns($driver);
|
||||
|
||||
// Начинаю формировать SQL
|
||||
$sql = (!str_starts_with($this->ColumnName, "FUNC:"))
|
||||
? "`$this->ColumnName`"
|
||||
? "$signOpen$this->ColumnName$signClose"
|
||||
: StringExtension::Replace('FUNC:', '', $this->ColumnName);
|
||||
|
||||
// Добавляю оператор
|
||||
|
Reference in New Issue
Block a user