DatabasePresenceVerifier

class DatabasePresenceVerifier implements PresenceVerifierInterface (View source)

Properties

protected ConnectionResolverInterface $db The database connection instance.
protected string $connection The database connection to use.

Methods

void __construct(ConnectionResolverInterface $db)

Create a new database presence verifier.

int getCount(string $collection, string $column, string $value, int $excludeId = null, string $idColumn = null, array $extra = [])

Count the number of objects in a collection having the given value.

int getMultiCount(string $collection, string $column, array $values, array $extra = [])

Count the number of objects in a collection with the given values.

void addWhere(Builder $query, string $key, string $extraValue)

Add a "where" clause to the given query.

Builder table(string $table)

Get a query builder for the given table.

void setConnection(string $connection)

Set the connection to be used.

Details

void __construct(ConnectionResolverInterface $db)

Create a new database presence verifier.

Parameters

ConnectionResolverInterface $db

Return Value

void

int getCount(string $collection, string $column, string $value, int $excludeId = null, string $idColumn = null, array $extra = [])

Count the number of objects in a collection having the given value.

Parameters

string $collection
string $column
string $value
int $excludeId
string $idColumn
array $extra

Return Value

int

int getMultiCount(string $collection, string $column, array $values, array $extra = [])

Count the number of objects in a collection with the given values.

Parameters

string $collection
string $column
array $values
array $extra

Return Value

int

protected void addWhere(Builder $query, string $key, string $extraValue)

Add a "where" clause to the given query.

Parameters

Builder $query
string $key
string $extraValue

Return Value

void

protected Builder table(string $table)

Get a query builder for the given table.

Parameters

string $table

Return Value

Builder

void setConnection(string $connection)

Set the connection to be used.

Parameters

string $connection

Return Value

void

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.1/Illuminate/Validation/DatabasePresenceVerifier.html