PHP Class LMongo\Eloquent\Builder

Afficher le fichier Open project: navruzm/lmongo Class Usage Examples

Protected Properties

Свойство Type Description
$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.

Méthodes publiques

Méthode Description
__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.

Méthodes protégées

Méthode Description
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.

Method Details

__call() public méthode

Dynamically handle calls into the query instance.
public __call ( string $method, array $parameters ) : mixed
$method string
$parameters array
Résultat mixed

__construct() public méthode

Create a new model query builder instance.
public __construct ( Builder $query ) : void
$query LMongo\Query\Builder
Résultat void

addUpdatedAtColumn() protected méthode

Add the "updated at" column to an array of values.
protected addUpdatedAtColumn ( array $values ) : array
$values array
Résultat array

decrement() public méthode

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
Résultat integer

delete() public méthode

Delete a record from the database.
public delete ( ) : integer
Résultat integer

eagerLoadRelations() public méthode

Eager load the relationships for the models.
public eagerLoadRelations ( array $models ) : array
$models array
Résultat array

find() public méthode

Find a model by its primary key.
public find ( mixed $id, array $columns = [] ) : Model | null
$id mixed
$columns array
Résultat Model | null

findOrFail() public méthode

Find a model by its primary key or throw an exception.
public findOrFail ( mixed $id, array $columns = [] ) : Model
$id mixed
$columns array
Résultat Model

first() public méthode

Execute the query and get the first result.
public first ( array $columns = [] ) : Model | null
$columns array
Résultat Model | null

firstOrFail() public méthode

Execute the query and get the first result or throw an exception.
public firstOrFail ( array $columns = [] ) : Model
$columns array
Résultat Model

forceDelete() public méthode

Force a delete on a set of soft deleted models.
public forceDelete ( ) : integer
Résultat integer

get() public méthode

Execute the query as a "select" statement.
public get ( array $columns = [] ) : Collection
$columns array
Résultat Collection

getEagerLoads() public méthode

Get the relationships being eagerly loaded.
public getEagerLoads ( ) : array
Résultat array

getModel() public méthode

Get the model instance being queried.
public getModel ( ) : Model
Résultat Model

getModels() public méthode

Get the hydrated models without eager loading.
public getModels ( array $columns = [] ) : array
$columns array
Résultat array

getQuery() public méthode

Get the underlying query builder instance.
public getQuery ( ) : Builder
Résultat LMongo\Query\Builder

getRelation() public méthode

Get the relation instance for the given relation name.
public getRelation ( string $relation ) : Relation
$relation string
Résultat LMongo\Eloquent\Relations\Relation

increment() public méthode

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
Résultat integer

isNested() protected méthode

Determine if the relationship is nested.
protected isNested ( string $name, string $relation ) : boolean
$name string
$relation string
Résultat boolean

isSoftDeleteConstraint() protected méthode

Determine if the given where clause is a soft delete constraint.
protected isSoftDeleteConstraint ( array $where, string $column ) : boolean
$where array
$column string
Résultat boolean

loadRelation() protected méthode

Eagerly load the relationship on a set of models.
protected loadRelation ( array $models, $name, Closure $constraints ) : array
$models array
$constraints Closure
Résultat array

nestedRelations() protected méthode

Get the deeply nested relations for a given top-level relation.
protected nestedRelations ( string $relation ) : array
$relation string
Résultat array

onlyTrashed() public méthode

Force the result set to only included soft deletes.
public onlyTrashed ( ) : Builder
Résultat Illuminate\Database\Eloquent\Builder

paginate() public méthode

Get a paginator for the "select" statement.
public paginate ( integer $perPage = null, array $columns = [] ) : Illuminate\Pagination\Paginator
$perPage integer
$columns array
Résultat Illuminate\Pagination\Paginator

parseNested() protected méthode

Parse the nested relationships in a relation.
protected parseNested ( string $name, array $results ) : array
$name string
$results array
Résultat array

parseRelations() protected méthode

Parse a list of relations into individuals.
protected parseRelations ( array $relations ) : array
$relations array
Résultat array

pluck() public méthode

Pluck a single column from the database.
public pluck ( string $column ) : mixed
$column string
Résultat mixed

restore() public méthode

Restore the soft-deleted model instances.
public restore ( ) : integer
Résultat integer

setEagerLoads() public méthode

Set the relationships being eagerly loaded.
public setEagerLoads ( array $eagerLoad ) : void
$eagerLoad array
Résultat void

setModel() public méthode

Set a model instance for the model being queried.
public setModel ( Model $model ) : Builder
$model Model
Résultat Builder

setQuery() public méthode

Set the underlying query builder instance.
public setQuery ( Builder $query ) : void
$query LMongo\Query\Builder
Résultat void

softDelete() protected méthode

Soft delete the record in the database.
protected softDelete ( ) : integer
Résultat integer

update() public méthode

Update a record in the database.
public update ( array $values ) : integer
$values array
Résultat integer

with() public méthode

Set the relationships that should be eager loaded.
public with ( $relations ) : Builder
Résultat Builder

withTrashed() public méthode

Include the soft deleted models in the results.
public withTrashed ( ) : LMongo\Eloquent\Builder
Résultat LMongo\Eloquent\Builder

Property Details

$eagerLoad protected_oe property

The relationships that should be eager loaded.
protected array $eagerLoad
Résultat array

$model protected_oe property

The model being queried.
protected Model,LMongo\Eloquent $model
Résultat Model

$passthru protected_oe property

The methods that should be returned from query builder.
protected array $passthru
Résultat array

$query protected_oe property

The base query builder instance.
protected Builder,LMongo\Eloquent $query
Résultat Builder

$total protected_oe property

Total count for paginate method.
protected array $total
Résultat array