This commit is contained in:
2025-08-19 23:38:52 +03:00
parent 5074629e40
commit cc3b1ef41b
8 changed files with 189 additions and 157 deletions

View File

@@ -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);
// Добавляю оператор