DatabasePresenceVerifier
in package
implements
PresenceVerifierInterface
Interfaces, Classes and Traits
Table of Contents
- $connection : string
- The database connection to use.
- $db : ConnectionResolverInterface
- The database connection instance.
- __construct() : void
- Create a new database presence verifier.
- getCount() : int
- Count the number of objects in a collection having the given value.
- getMultiCount() : int
- Count the number of objects in a collection with the given values.
- setConnection() : void
- Set the connection to be used.
- addConditions() : Builder
- Add the given conditions to the query.
- addWhere() : void
- Add a "where" clause to the given query.
- table() : Builder
- Get a query builder for the given table.
Properties
$connection
The database connection to use.
protected
string
$connection
$db
The database connection instance.
protected
ConnectionResolverInterface
$db
Methods
__construct()
Create a new database presence verifier.
public
__construct(ConnectionResolverInterface $db) : void
Parameters
Return values
void —getCount()
Count the number of objects in a collection having the given value.
public
getCount(string $collection, string $column, string $value[, int|null $excludeId = null ][, string|null $idColumn = null ][, array<string|int, mixed> $extra = [] ]) : int
Parameters
- $collection : string
- $column : string
- $value : string
- $excludeId : int|null = null
- $idColumn : string|null = null
- $extra : array<string|int, mixed> = []
Return values
int —getMultiCount()
Count the number of objects in a collection with the given values.
public
getMultiCount(string $collection, string $column, array<string|int, mixed> $values[, array<string|int, mixed> $extra = [] ]) : int
Parameters
- $collection : string
- $column : string
- $values : array<string|int, mixed>
- $extra : array<string|int, mixed> = []
Return values
int —setConnection()
Set the connection to be used.
public
setConnection(string $connection) : void
Parameters
- $connection : string
Return values
void —addConditions()
Add the given conditions to the query.
protected
addConditions(Builder $query, array<string|int, mixed> $conditions) : Builder
Parameters
- $query : Builder
- $conditions : array<string|int, mixed>
Return values
Builder —addWhere()
Add a "where" clause to the given query.
protected
addWhere(Builder $query, string $key, string $extraValue) : void
Parameters
- $query : Builder
- $key : string
- $extraValue : string
Return values
void —table()
Get a query builder for the given table.
protected
table(string $table) : Builder
Parameters
- $table : string