refactor(model): Fix typo on WHERE EXISTS/NOT EXISTS methods
This commit is contained in:
@@ -166,9 +166,9 @@ class Model
|
|||||||
|
|
||||||
throw new Exception(
|
throw new Exception(
|
||||||
"\nError at query to database.\n" .
|
"\nError at query to database.\n" .
|
||||||
"Query: $query\n" .
|
"Query: $query\n" .
|
||||||
"Vars: $vars\n" .
|
"Vars: $vars\n" .
|
||||||
"Error:\n" . $e->getMessage()
|
"Error:\n" . $e->getMessage()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -731,30 +731,30 @@ class Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines WHERE using EXIST in the SQL statement.
|
* Defines WHERE using EXISTS in the SQL statement.
|
||||||
*
|
*
|
||||||
* @param string $query
|
* @param string $query
|
||||||
* SQL query.
|
* SQL query.
|
||||||
*
|
*
|
||||||
* @return static
|
* @return static
|
||||||
*/
|
*/
|
||||||
public static function whereExist(string $query): static
|
public static function whereExists(string $query): static
|
||||||
{
|
{
|
||||||
static::where($column, 'EXIST', "($query)", true);
|
static::where('', 'EXISTS', "($query)", true);
|
||||||
return new static();
|
return new static();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines WHERE using NOT EXIST in the SQL statement.
|
* Defines WHERE using NOT EXISTS in the SQL statement.
|
||||||
*
|
*
|
||||||
* @param string $query
|
* @param string $query
|
||||||
* SQL query.
|
* SQL query.
|
||||||
*
|
*
|
||||||
* @return static
|
* @return static
|
||||||
*/
|
*/
|
||||||
public static function whereNotExist(string $query): static
|
public static function whereNotExists(string $query): static
|
||||||
{
|
{
|
||||||
static::where($column, 'NOT EXIST', "($query)", true);
|
static::where('', 'NOT EXISTS', "($query)", true);
|
||||||
return new static();
|
return new static();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user