PHP 클래스 LMongo\Eloquent\Builder

파일 보기 프로젝트 열기: navruzm/lmongo 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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