refactor(Model): Rename bindValue to bind and make public

This commit is contained in:
kj
2025-10-17 11:55:37 -03:00
parent 20fd78ab53
commit a0b544eae5

View File

@@ -259,7 +259,7 @@ class Model
* @return string
* Substitution parameter.
*/
private static function bindValue(string $value): string
public static function bind(string $value): string
{
$index = ':v_' . count(static::$queryVars);
static::$queryVars[$index] = $value;
@@ -582,7 +582,7 @@ class Model
}
if (!$no_filter) {
$value = static::bindValue($value);
$value = static::bind($value);
}
if (static::$querySelect['where'] == '') {
@@ -624,7 +624,7 @@ class Model
}
if (!$no_filter) {
$value = static::bindValue($value);
$value = static::bind($value);
}
if (static::$querySelect['where'] == '') {
@@ -657,7 +657,7 @@ class Model
): static {
$arrIn = [];
foreach ($arr as $value) {
$arrIn[] = static::bindValue($value);
$arrIn[] = static::bind($value);
}
if ($in) {
@@ -922,7 +922,7 @@ class Model
$in = array_keys((new $className())->getVars());
}
$search = static::bindValue($search);
$search = static::bind($search);
$where = [];
if (DB_TYPE == 'sqlite') {