refactor(Model): Rename bindValue to bind and make public
This commit is contained in:
@@ -259,7 +259,7 @@ class Model
|
|||||||
* @return string
|
* @return string
|
||||||
* Substitution parameter.
|
* Substitution parameter.
|
||||||
*/
|
*/
|
||||||
private static function bindValue(string $value): string
|
public static function bind(string $value): string
|
||||||
{
|
{
|
||||||
$index = ':v_' . count(static::$queryVars);
|
$index = ':v_' . count(static::$queryVars);
|
||||||
static::$queryVars[$index] = $value;
|
static::$queryVars[$index] = $value;
|
||||||
@@ -582,7 +582,7 @@ class Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$no_filter) {
|
if (!$no_filter) {
|
||||||
$value = static::bindValue($value);
|
$value = static::bind($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (static::$querySelect['where'] == '') {
|
if (static::$querySelect['where'] == '') {
|
||||||
@@ -624,7 +624,7 @@ class Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$no_filter) {
|
if (!$no_filter) {
|
||||||
$value = static::bindValue($value);
|
$value = static::bind($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (static::$querySelect['where'] == '') {
|
if (static::$querySelect['where'] == '') {
|
||||||
@@ -657,7 +657,7 @@ class Model
|
|||||||
): static {
|
): static {
|
||||||
$arrIn = [];
|
$arrIn = [];
|
||||||
foreach ($arr as $value) {
|
foreach ($arr as $value) {
|
||||||
$arrIn[] = static::bindValue($value);
|
$arrIn[] = static::bind($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($in) {
|
if ($in) {
|
||||||
@@ -922,7 +922,7 @@ class Model
|
|||||||
$in = array_keys((new $className())->getVars());
|
$in = array_keys((new $className())->getVars());
|
||||||
}
|
}
|
||||||
|
|
||||||
$search = static::bindValue($search);
|
$search = static::bind($search);
|
||||||
$where = [];
|
$where = [];
|
||||||
|
|
||||||
if (DB_TYPE == 'sqlite') {
|
if (DB_TYPE == 'sqlite') {
|
||||||
|
|||||||
Reference in New Issue
Block a user