PHP Класс LMongo\Eloquent\Builder

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$eagerLoad array The relationships that should be eager loaded.
$model Model The model being queried.
$passthru array The methods that should be returned from query builder.
$query Builder The base query builder instance.
$total array Total count for paginate method.

Открытые методы

Метод Описание
__call ( string $method, array $parameters ) : mixed Dynamically handle calls into the query instance.
__construct ( Builder $query ) : void Create a new model query builder instance.
decrement ( string $column, integer $amount = 1, array $extra = [] ) : integer Decrement a column's value by a given amount.
delete ( ) : integer Delete a record from the database.
eagerLoadRelations ( array $models ) : array Eager load the relationships for the models.
find ( mixed $id, array $columns = [] ) : Model | null Find a model by its primary key.
findOrFail ( mixed $id, array $columns = [] ) : Model Find a model by its primary key or throw an exception.
first ( array $columns = [] ) : Model | null Execute the query and get the first result.
firstOrFail ( array $columns = [] ) : Model Execute the query and get the first result or throw an exception.
forceDelete ( ) : integer Force a delete on a set of soft deleted models.
get ( array $columns = [] ) : Collection Execute the query as a "select" statement.
getEagerLoads ( ) : array Get the relationships being eagerly loaded.
getModel ( ) : Model Get the model instance being queried.
getModels ( array $columns = [] ) : array Get the hydrated models without eager loading.
getQuery ( ) : Builder Get the underlying query builder instance.
getRelation ( string $relation ) : Relation Get the relation instance for the given relation name.
increment ( string $column, integer $amount = 1, array $extra = [] ) : integer Increment a column's value by a given amount.
onlyTrashed ( ) : Builder Force the result set to only included soft deletes.
paginate ( integer $perPage = null, array $columns = [] ) : Illuminate\Pagination\Paginator Get a paginator for the "select" statement.
pluck ( string $column ) : mixed Pluck a single column from the database.
restore ( ) : integer Restore the soft-deleted model instances.
setEagerLoads ( array $eagerLoad ) : void Set the relationships being eagerly loaded.
setModel ( Model $model ) : Builder Set a model instance for the model being queried.
setQuery ( Builder $query ) : void Set the underlying query builder instance.
update ( array $values ) : integer Update a record in the database.
with ( $relations ) : Builder Set the relationships that should be eager loaded.
withTrashed ( ) : LMongo\Eloquent\Builder Include the soft deleted models in the results.

Защищенные методы

Метод Описание
addUpdatedAtColumn ( array $values ) : array Add the "updated at" column to an array of values.
isNested ( string $name, string $relation ) : boolean Determine if the relationship is nested.
isSoftDeleteConstraint ( array $where, string $column ) : boolean Determine if the given where clause is a soft delete constraint.
loadRelation ( array $models, $name, Closure $constraints ) : array Eagerly load the relationship on a set of models.
nestedRelations ( string $relation ) : array Get the deeply nested relations for a given top-level relation.
parseNested ( string $name, array $results ) : array Parse the nested relationships in a relation.
parseRelations ( array $relations ) : array Parse a list of relations into individuals.
softDelete ( ) : integer Soft delete the record in the database.

Описание методов

__call() публичный Метод

Dynamically handle calls into the query instance.
public __call ( string $method, array $parameters ) : mixed
$method string
$parameters array
Результат mixed

__construct() публичный Метод

Create a new model query builder instance.
public __construct ( Builder $query ) : void
$query LMongo\Query\Builder
Результат void

addUpdatedAtColumn() защищенный Метод

Add the "updated at" column to an array of values.
protected addUpdatedAtColumn ( array $values ) : array
$values array
Результат array

decrement() публичный Метод

Decrement a column's value by a given amount.
public decrement ( string $column, integer $amount = 1, array $extra = [] ) : integer
$column string
$amount integer
$extra array
Результат integer

delete() публичный Метод

Delete a record from the database.
public delete ( ) : integer
Результат integer

eagerLoadRelations() публичный Метод

Eager load the relationships for the models.
public eagerLoadRelations ( array $models ) : array
$models array
Результат array

find() публичный Метод

Find a model by its primary key.
public find ( mixed $id, array $columns = [] ) : Model | null
$id mixed
$columns array
Результат Model | null

findOrFail() публичный Метод

Find a model by its primary key or throw an exception.
public findOrFail ( mixed $id, array $columns = [] ) : Model
$id mixed
$columns array
Результат Model

first() публичный Метод

Execute the query and get the first result.
public first ( array $columns = [] ) : Model | null
$columns array
Результат Model | null

firstOrFail() публичный Метод

Execute the query and get the first result or throw an exception.
public firstOrFail ( array $columns = [] ) : Model
$columns array
Результат Model

forceDelete() публичный Метод

Force a delete on a set of soft deleted models.
public forceDelete ( ) : integer
Результат integer

get() публичный Метод

Execute the query as a "select" statement.
public get ( array $columns = [] ) : Collection
$columns array
Результат Collection

getEagerLoads() публичный Метод

Get the relationships being eagerly loaded.
public getEagerLoads ( ) : array
Результат array

getModel() публичный Метод

Get the model instance being queried.
public getModel ( ) : Model
Результат Model

getModels() публичный Метод

Get the hydrated models without eager loading.
public getModels ( array $columns = [] ) : array
$columns array
Результат array

getQuery() публичный Метод

Get the underlying query builder instance.
public getQuery ( ) : Builder
Результат LMongo\Query\Builder

getRelation() публичный Метод

Get the relation instance for the given relation name.
public getRelation ( string $relation ) : Relation
$relation string
Результат LMongo\Eloquent\Relations\Relation

increment() публичный Метод

Increment a column's value by a given amount.
public increment ( string $column, integer $amount = 1, array $extra = [] ) : integer
$column string
$amount integer
$extra array
Результат integer

isNested() защищенный Метод

Determine if the relationship is nested.
protected isNested ( string $name, string $relation ) : boolean
$name string
$relation string
Результат boolean

isSoftDeleteConstraint() защищенный Метод

Determine if the given where clause is a soft delete constraint.
protected isSoftDeleteConstraint ( array $where, string $column ) : boolean
$where array
$column string
Результат boolean

loadRelation() защищенный Метод

Eagerly load the relationship on a set of models.
protected loadRelation ( array $models, $name, Closure $constraints ) : array
$models array
$constraints Closure
Результат array

nestedRelations() защищенный Метод

Get the deeply nested relations for a given top-level relation.
protected nestedRelations ( string $relation ) : array
$relation string
Результат array

onlyTrashed() публичный Метод

Force the result set to only included soft deletes.
public onlyTrashed ( ) : Builder
Результат Illuminate\Database\Eloquent\Builder

paginate() публичный Метод

Get a paginator for the "select" statement.
public paginate ( integer $perPage = null, array $columns = [] ) : Illuminate\Pagination\Paginator
$perPage integer
$columns array
Результат Illuminate\Pagination\Paginator

parseNested() защищенный Метод

Parse the nested relationships in a relation.
protected parseNested ( string $name, array $results ) : array
$name string
$results array
Результат array

parseRelations() защищенный Метод

Parse a list of relations into individuals.
protected parseRelations ( array $relations ) : array
$relations array
Результат array

pluck() публичный Метод

Pluck a single column from the database.
public pluck ( string $column ) : mixed
$column string
Результат mixed

restore() публичный Метод

Restore the soft-deleted model instances.
public restore ( ) : integer
Результат integer

setEagerLoads() публичный Метод

Set the relationships being eagerly loaded.
public setEagerLoads ( array $eagerLoad ) : void
$eagerLoad array
Результат void

setModel() публичный Метод

Set a model instance for the model being queried.
public setModel ( Model $model ) : Builder
$model Model
Результат Builder

setQuery() публичный Метод

Set the underlying query builder instance.
public setQuery ( Builder $query ) : void
$query LMongo\Query\Builder
Результат void

softDelete() защищенный Метод

Soft delete the record in the database.
protected softDelete ( ) : integer
Результат integer

update() публичный Метод

Update a record in the database.
public update ( array $values ) : integer
$values array
Результат integer

with() публичный Метод

Set the relationships that should be eager loaded.
public with ( $relations ) : Builder
Результат Builder

withTrashed() публичный Метод

Include the soft deleted models in the results.
public withTrashed ( ) : LMongo\Eloquent\Builder
Результат LMongo\Eloquent\Builder

Описание свойств

$eagerLoad защищенное свойство

The relationships that should be eager loaded.
protected array $eagerLoad
Результат array

$model защищенное свойство

The model being queried.
protected Model,LMongo\Eloquent $model
Результат Model

$passthru защищенное свойство

The methods that should be returned from query builder.
protected array $passthru
Результат array

$query защищенное свойство

The base query builder instance.
protected Builder,LMongo\Eloquent $query
Результат Builder

$total защищенное свойство

Total count for paginate method.
protected array $total
Результат array