PHP Класс LMongo\Eloquent\Model

Наследование: implements ArrayAcces\ArrayAccess, implements Illuminate\Support\Contracts\ArrayableInterface, implements Illuminate\Support\Contracts\JsonableInterface
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$exists boolean Indicates if the model exists.
$incrementing boolean Indicates if the IDs are auto-incrementing.
$snakeAttributes boolean Indicates whether attributes are snake cased on arrays.
$timestamps boolean Indicates if the model should be timestamped.

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

Свойство Тип Описание
$attributes array The model's attributes.
$booted array The array of booted models.
$collection string The collection associated with the model.
$connection string The connection name for the model.
$dispatcher Illuminate\Events\Dispatcher The event dispatcher instance.
$fillable array The attributes that are mass assignable.
$guarded array The attributes that aren't mass assignable.
$hidden array The attributes that should be hidden for arrays.
$mutatorCache array The cache of the mutated attributes for each class.
$original array The model attribute's original state.
$perPage integer The number of models to return for pagination.
$primaryKey string The primary key for the model.
$relations array The loaded relationships for the model.
$resolver LMongo\ConnectionResolverInterface The connection resolver instance.
$softDelete boolean Indicates if the model should soft delete.
$touches array The relationships that should be touched on save.
$unguarded boolean Indicates if all mass assignment is enabled.
$visible arrays The attributes that should be visible in arrays.
$with array The relations to eager load on every query.

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

Метод Описание
__call ( string $method, array $parameters ) : mixed Handle dynamic method calls into the method.
__callStatic ( string $method, array $parameters ) : mixed Handle dynamic static method calls into the method.
__construct ( array $attributes = [] ) : void Create a new Eloquent model instance.
__get ( string $key ) : mixed Dynamically retrieve attributes on the model.
__isset ( string $key ) : void Determine if an attribute exists on the model.
__set ( string $key, mixed $value ) : void Dynamically set attributes on the model.
__toString ( ) : string Convert the model to its string representation.
__unset ( string $key ) : void Unset an attribute on the model.
all ( array $columns = [] ) : Collection Get all of the models from the database.
attributesToArray ( ) : array Convert the model's attributes to an array.
belongsTo ( string $related, string $foreignKey = null ) : BelongsTo Define an inverse one-to-one or many relationship.
belongsToMany ( string $related, string $foreignKey = null, string $otherKey = null ) : BelongsToMany Define a many-to-many relationship.
collection ( string $collection ) : void Set the collection associated with the model.
create ( array $attributes ) : Model Save a new model and return the instance.
created ( Closur\Closure | string $callback ) : void Register a created model event with the dispatcher.
creating ( Closur\Closure | string $callback ) : void Register a creating model event with the dispatcher.
delete ( ) : boolean | null Delete the model from the database.
deleted ( Closur\Closure | string $callback ) : void Register a deleted model event with the dispatcher.
deleting ( Closur\Closure | string $callback ) : void Register a deleting model event with the dispatcher.
destroy ( array | integer $ids ) : void Destroy the models for the given IDs.
fill ( array $attributes ) : Model Fill the model with an array of attributes.
fillable ( array $fillable ) : Model Set the fillable attributes for the model.
find ( mixed $id, array $columns = [] ) : Model | Collection Find a model by its primary key.
findOrFail ( mixed $id, array $columns = [] ) : Model | Collection Find a model by its primary key or throw an exception.
flushEventListeners ( ) : void Remove all of the event listeners for the model.
forceDelete ( ) : void Force a hard delete on a soft deleted model.
freshTimestamp ( ) : MongoDate Get a fresh MongoDate for the model.
getAttribute ( string $key ) : mixed Get an attribute from the model.
getAttributes ( ) : array Get all of the current attributes on the model.
getCollection ( ) : string Get the collection associated with the model.
getConnection ( ) : Connection Get the database connection for the model.
getConnectionName ( ) : string Get the current connection name for the model.
getConnectionResolver ( ) : LMongo\ConnectionResolverInterface Get the connection resolver instance.
getCreatedAtColumn ( ) : string Get the name of the "created at" column.
getDates ( ) : array Get the attributes that should be converted to dates.
getDeletedAtColumn ( ) : string Get the name of the "deleted at" column.
getDirty ( ) : array Get the attributes that have been changed since last sync.
getEventDispatcher ( ) : Illuminate\Events\Dispatcher Get the event dispatcher instance.
getFillable ( ) : array Get the fillable attributes for the model.
getForeignKey ( ) : string Get the default foreign key name for the model.
getHidden ( ) : array Get the hidden attributes for the model.
getIncrementing ( ) : boolean Get the value indicating whether the IDs are incrementing.
getKey ( ) : mixed Get the value of the model's primary key.
getKeyName ( ) : string Get the primary key for the model.
getMutatedAttributes ( ) : array Get the mutated attributes for a given instance.
getObservableEvents ( ) : array Get the observable event names.
getOriginal ( string $key = null, mixed $default = null ) : array Get the model's original attribute values.
getPerPage ( ) : integer Get the number of models to return per page.
getQualifiedDeletedAtColumn ( ) : string Get the fully qualified "deleted at" column.
getRelation ( string $relation ) : mixed Get a specified relationship.
getRelations ( ) : array Get all the loaded relations for the instance.
getTouchedRelations ( ) : array Get the relationships that are touched on save.
getUpdatedAtColumn ( ) : string Get the name of the "updated at" column.
guard ( array $guarded ) : Model Set the guarded attributes for the model.
hasGetMutator ( string $key ) : boolean Determine if a get mutator exists for an attribute.
hasMany ( string $related, string $foreignKey = null ) : HasMany Define a one-to-many relationship.
hasOne ( string $related, string $foreignKey = null ) : LMongo\Eloquent\Relation\HasOne Define a one-to-one relationship.
hasSetMutator ( string $key ) : boolean Determine if a set mutator exists for an attribute.
isDirty ( string $attribute ) : boolean Determine if a given attribute is dirty.
isFillable ( string $key ) : boolean Determine if the given attribute may be mass assigned.
isGuarded ( string $key ) : boolean Determine if the given key is guarded.
isSoftDeleting ( ) : boolean Determine if the model instance uses soft deletes.
load ( array | string $relations ) : void Eager load relations on the model.
morphMany ( string $related, string $name, string $type = null, string $id = null ) : LMongo\Eloquent\Relation\MorphMany Define a polymorphic one-to-many relationship.
morphOne ( string $related, string $name, string $type = null, string $id = null ) : LMongo\Eloquent\Relation\MorphOne Define a polymorphic one-to-one relationship.
morphTo ( string $name = null, string $type = null, string $id = null ) : BelongsTo Define an polymorphic, inverse one-to-one or many relationship.
newCollection ( array $models = [] ) : Collection Create a new Collection instance.
newFromBuilder ( array $attributes = [] ) : Model Create a new model instance that is existing.
newInstance ( array $attributes = [], boolean $exists = false ) : Model Create a new instance of the given model.
newQuery ( boolean $excludeDeleted = true ) : Builder Get a new query builder for the model's table.
newQueryWithDeleted ( ) : Builder Get a new query builder that includes soft deletes.
observe ( object $class ) : void Register an observer with the Model.
offsetExists ( mixed $offset ) : boolean Determine if the given attribute exists.
offsetGet ( mixed $offset ) : mixed Get the value for a given offset.
offsetSet ( mixed $offset, mixed $value ) : void Set the value for a given offset.
offsetUnset ( mixed $offset ) : void Unset the value for a given offset.
on ( string $connection = null ) : Builder Begin querying the model on a given connection.
onlyTrashed ( ) : Builder Get a new query builder that only includes soft deletes.
push ( ) : boolean Save the model and all of its relationships.
query ( ) : Builder Begin querying the model.
reguard ( ) : void Enable the mass assignment restrictions.
relationsToArray ( ) : array Get the model's relationships in array form.
replicate ( ) : Model Clone the model into a new, non-existing instance.
resolveConnection ( string $connection = null ) : Connection Resolve a connection instance.
restore ( ) : boolean | null Restore a soft-deleted model instance.
save ( ) : boolean Save the model to the database.
saved ( Closur\Closure | string $callback ) : void Register a saved model event with the dispatcher.
saving ( Closur\Closure | string $callback ) : void Register a saving model event with the dispatcher.
setAttribute ( string $key, mixed $value ) : void Set a given attribute on the model.
setConnection ( string $name ) : void Set the connection associated with the model.
setConnectionResolver ( LMongo\ConnectionResolverInterface $resolver ) : void Set the connection resolver instance.
setCreatedAt ( mixed $value ) : void Set the value of the "created at" attribute.
setEventDispatcher ( Illuminate\Events\Dispatcher $dispatcher ) : void Set the event dispatcher instance.
setHidden ( array $hidden ) : void Set the hidden attributes for the model.
setIncrementing ( boolean $value ) : void Set whether IDs are incrementing.
setPerPage ( integer $perPage ) : void Set the number of models ot return per page.
setRawAttributes ( array $attributes, boolean $sync = false ) : void Set the array of model attributes. No checking is done.
setRelation ( string $relation, mixed $value ) : Model Set the specific relationship in the model.
setRelations ( array $relations ) : Model Set the entire relations array on the model.
setSoftDeleting ( boolean $enabled ) : void Set the soft deleting property on the model.
setTouchedRelations ( array $touches ) : void Set the relationships that are touched on save.
setUnguardState ( boolean $state ) : void Set "unguard" to a given state.
setUpdatedAt ( mixed $value ) : void Set the value of the "updated at" attribute.
setVisible ( array $visible ) : void Set the visible attributes for the model.
syncOriginal ( ) : Model Sync the original attributes with the current.
toArray ( ) : array Convert the model instance to an array.
toJson ( integer $options ) : string Convert the model instance to JSON.
totallyGuarded ( ) : boolean Determine if the model is totally guarded.
touch ( ) : boolean Update the model's update timestamp.
touchOwners ( ) : void Touch the owning relations of the model.
touches ( string $relation ) : boolean Determine if the model touches a given relation.
trashed ( ) : boolean Determine if the model instance has been soft-deleted.
unguard ( ) : void Disable all mass assignable restrictions.
unsetEventDispatcher ( ) : void Unset the event dispatcher for models.
update ( array $attributes = [] ) : mixed Update the model in the database.
updated ( Closur\Closure | string $callback ) : void Register an updated model event with the dispatcher.
updating ( Closur\Closure | string $callback ) : void Register an updating model event with the dispatcher.
usesTimestamps ( ) : boolean Determine if the model uses timestamps.
with ( array | string $relations ) : Builder Being querying a model with eager loading.
withTrashed ( ) : Builder Get a new query builder that includes soft deletes.

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

Метод Описание
asDateTime ( mixed $value ) : DateTime Return a timestamp as DateTime object.
boot ( ) : void The "booting" method of the model.
decrement ( string $column, integer $amount = 1 ) : integer Decrement a column's value by a given amount.
finishSave ( ) : void Finish processing on a successful save operation.
fireModelEvent ( string $event, boolean $halt = true ) : mixed Fire the given event for the model.
fromDateTime ( DateTim\DateTime | integer $value ) : string Convert a DateTime to a storable string.
getArrayableAttributes ( ) : array Get an attribute array of all arrayable attributes.
getAttributeFromArray ( string $key ) : mixed Get an attribute from the $attributes array.
getAttributeValue ( string $key ) : mixed Get a plain attribute (not a relationship).
getDateFormat ( ) : string Get the format for database stored dates.
getMorphs ( string $name, string $type, string $id ) : array Get the polymorphic relationship columns.
increment ( string $column, integer $amount = 1 ) : integer Increment a column's value by a given amount.
incrementOrDecrement ( string $column, integer $amount, string $method ) : integer Run the increment or decrement method on the model.
insertAndSetId ( Builder $query, array $attributes ) : void Insert the given attributes and set the ID on the model.
mutateAttribute ( string $key, mixed $value ) : mixed Get the value of an attribute using its mutator.
newBaseQueryBuilder ( ) : Builder Get a new query builder instance for the connection.
performDeleteOnModel ( ) : void Perform the actual delete query on this model instance.
performInsert ( $query ) : boolean Perform a model insert operation.
performUpdate ( $query ) : boolean Perform a model update operation.
registerModelEvent ( string $event, Closur\Closure | string $callback ) : void Register a model event with the dispatcher.
setKeysForSaveQuery ( $query ) : Builder Set the keys for a save update query.
updateTimestamps ( ) : void Update the creation and update timestamps.

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

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

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

__callStatic() публичный статический Метод

Handle dynamic static method calls into the method.
public static __callStatic ( string $method, array $parameters ) : mixed
$method string
$parameters array
Результат mixed

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

Create a new Eloquent model instance.
public __construct ( array $attributes = [] ) : void
$attributes array
Результат void

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

Dynamically retrieve attributes on the model.
public __get ( string $key ) : mixed
$key string
Результат mixed

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

Determine if an attribute exists on the model.
public __isset ( string $key ) : void
$key string
Результат void

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

Dynamically set attributes on the model.
public __set ( string $key, mixed $value ) : void
$key string
$value mixed
Результат void

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

Convert the model to its string representation.
public __toString ( ) : string
Результат string

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

Unset an attribute on the model.
public __unset ( string $key ) : void
$key string
Результат void

all() публичный статический Метод

Get all of the models from the database.
public static all ( array $columns = [] ) : Collection
$columns array
Результат Collection

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

Return a timestamp as DateTime object.
protected asDateTime ( mixed $value ) : DateTime
$value mixed
Результат DateTime

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

Convert the model's attributes to an array.
public attributesToArray ( ) : array
Результат array

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

Define an inverse one-to-one or many relationship.
public belongsTo ( string $related, string $foreignKey = null ) : BelongsTo
$related string
$foreignKey string
Результат LMongo\Eloquent\Relations\BelongsTo

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

Define a many-to-many relationship.
public belongsToMany ( string $related, string $foreignKey = null, string $otherKey = null ) : BelongsToMany
$related string
$foreignKey string
$otherKey string
Результат LMongo\Eloquent\Relations\BelongsToMany

boot() защищенный статический Метод

The "booting" method of the model.
protected static boot ( ) : void
Результат void

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

Set the collection associated with the model.
public collection ( string $collection ) : void
$collection string
Результат void

create() публичный статический Метод

Save a new model and return the instance.
public static create ( array $attributes ) : Model
$attributes array
Результат Model

created() публичный статический Метод

Register a created model event with the dispatcher.
public static created ( Closur\Closure | string $callback ) : void
$callback Closur\Closure | string
Результат void

creating() публичный статический Метод

Register a creating model event with the dispatcher.
public static creating ( Closur\Closure | string $callback ) : void
$callback Closur\Closure | string
Результат void

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

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

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

Delete the model from the database.
public delete ( ) : boolean | null
Результат boolean | null

deleted() публичный статический Метод

Register a deleted model event with the dispatcher.
public static deleted ( Closur\Closure | string $callback ) : void
$callback Closur\Closure | string
Результат void

deleting() публичный статический Метод

Register a deleting model event with the dispatcher.
public static deleting ( Closur\Closure | string $callback ) : void
$callback Closur\Closure | string
Результат void

destroy() публичный статический Метод

Destroy the models for the given IDs.
public static destroy ( array | integer $ids ) : void
$ids array | integer
Результат void

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

Fill the model with an array of attributes.
public fill ( array $attributes ) : Model
$attributes array
Результат Model

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

Set the fillable attributes for the model.
public fillable ( array $fillable ) : Model
$fillable array
Результат Model

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

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

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

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

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

Finish processing on a successful save operation.
protected finishSave ( ) : void
Результат void

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

Fire the given event for the model.
protected fireModelEvent ( string $event, boolean $halt = true ) : mixed
$event string
$halt boolean
Результат mixed

flushEventListeners() публичный статический Метод

Remove all of the event listeners for the model.
public static flushEventListeners ( ) : void
Результат void

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

Force a hard delete on a soft deleted model.
public forceDelete ( ) : void
Результат void

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

Get a fresh MongoDate for the model.
public freshTimestamp ( ) : MongoDate
Результат MongoDate

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

Convert a DateTime to a storable string.
protected fromDateTime ( DateTim\DateTime | integer $value ) : string
$value DateTim\DateTime | integer
Результат string

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

Get an attribute array of all arrayable attributes.
protected getArrayableAttributes ( ) : array
Результат array

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

Get an attribute from the model.
public getAttribute ( string $key ) : mixed
$key string
Результат mixed

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

Get an attribute from the $attributes array.
protected getAttributeFromArray ( string $key ) : mixed
$key string
Результат mixed

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

Get a plain attribute (not a relationship).
protected getAttributeValue ( string $key ) : mixed
$key string
Результат mixed

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

Get all of the current attributes on the model.
public getAttributes ( ) : array
Результат array

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

Get the collection associated with the model.
public getCollection ( ) : string
Результат string

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

Get the database connection for the model.
public getConnection ( ) : Connection
Результат LMongo\Connection

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

Get the current connection name for the model.
public getConnectionName ( ) : string
Результат string

getConnectionResolver() публичный статический Метод

Get the connection resolver instance.
public static getConnectionResolver ( ) : LMongo\ConnectionResolverInterface
Результат LMongo\ConnectionResolverInterface

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

Get the name of the "created at" column.
public getCreatedAtColumn ( ) : string
Результат string

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

Get the format for database stored dates.
protected getDateFormat ( ) : string
Результат string

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

Get the attributes that should be converted to dates.
public getDates ( ) : array
Результат array

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

Get the name of the "deleted at" column.
public getDeletedAtColumn ( ) : string
Результат string

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

Get the attributes that have been changed since last sync.
public getDirty ( ) : array
Результат array

getEventDispatcher() публичный статический Метод

Get the event dispatcher instance.
public static getEventDispatcher ( ) : Illuminate\Events\Dispatcher
Результат Illuminate\Events\Dispatcher

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

Get the fillable attributes for the model.
public getFillable ( ) : array
Результат array

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

Get the default foreign key name for the model.
public getForeignKey ( ) : string
Результат string

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

Get the hidden attributes for the model.
public getHidden ( ) : array
Результат array

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

Get the value indicating whether the IDs are incrementing.
public getIncrementing ( ) : boolean
Результат boolean

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

Get the value of the model's primary key.
public getKey ( ) : mixed
Результат mixed

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

Get the primary key for the model.
public getKeyName ( ) : string
Результат string

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

Get the polymorphic relationship columns.
protected getMorphs ( string $name, string $type, string $id ) : array
$name string
$type string
$id string
Результат array

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

Get the mutated attributes for a given instance.
public getMutatedAttributes ( ) : array
Результат array

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

Get the observable event names.
public getObservableEvents ( ) : array
Результат array

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

Get the model's original attribute values.
public getOriginal ( string $key = null, mixed $default = null ) : array
$key string
$default mixed
Результат array

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

Get the number of models to return per page.
public getPerPage ( ) : integer
Результат integer

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

Get the fully qualified "deleted at" column.
public getQualifiedDeletedAtColumn ( ) : string
Результат string

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

Get a specified relationship.
public getRelation ( string $relation ) : mixed
$relation string
Результат mixed

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

Get all the loaded relations for the instance.
public getRelations ( ) : array
Результат array

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

Get the relationships that are touched on save.
public getTouchedRelations ( ) : array
Результат array

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

Get the name of the "updated at" column.
public getUpdatedAtColumn ( ) : string
Результат string

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

Set the guarded attributes for the model.
public guard ( array $guarded ) : Model
$guarded array
Результат Model

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

Determine if a get mutator exists for an attribute.
public hasGetMutator ( string $key ) : boolean
$key string
Результат boolean

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

Define a one-to-many relationship.
public hasMany ( string $related, string $foreignKey = null ) : HasMany
$related string
$foreignKey string
Результат LMongo\Eloquent\Relations\HasMany

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

Define a one-to-one relationship.
public hasOne ( string $related, string $foreignKey = null ) : LMongo\Eloquent\Relation\HasOne
$related string
$foreignKey string
Результат LMongo\Eloquent\Relation\HasOne

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

Determine if a set mutator exists for an attribute.
public hasSetMutator ( string $key ) : boolean
$key string
Результат boolean

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

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

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

Run the increment or decrement method on the model.
protected incrementOrDecrement ( string $column, integer $amount, string $method ) : integer
$column string
$amount integer
$method string
Результат integer

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

Insert the given attributes and set the ID on the model.
protected insertAndSetId ( Builder $query, array $attributes ) : void
$query Builder
$attributes array
Результат void

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

Determine if a given attribute is dirty.
public isDirty ( string $attribute ) : boolean
$attribute string
Результат boolean

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

Determine if the given attribute may be mass assigned.
public isFillable ( string $key ) : boolean
$key string
Результат boolean

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

Determine if the given key is guarded.
public isGuarded ( string $key ) : boolean
$key string
Результат boolean

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

Determine if the model instance uses soft deletes.
public isSoftDeleting ( ) : boolean
Результат boolean

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

Eager load relations on the model.
public load ( array | string $relations ) : void
$relations array | string
Результат void

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

Define a polymorphic one-to-many relationship.
public morphMany ( string $related, string $name, string $type = null, string $id = null ) : LMongo\Eloquent\Relation\MorphMany
$related string
$name string
$type string
$id string
Результат LMongo\Eloquent\Relation\MorphMany

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

Define a polymorphic one-to-one relationship.
public morphOne ( string $related, string $name, string $type = null, string $id = null ) : LMongo\Eloquent\Relation\MorphOne
$related string
$name string
$type string
$id string
Результат LMongo\Eloquent\Relation\MorphOne

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

Define an polymorphic, inverse one-to-one or many relationship.
public morphTo ( string $name = null, string $type = null, string $id = null ) : BelongsTo
$name string
$type string
$id string
Результат LMongo\Eloquent\Relations\BelongsTo

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

Get the value of an attribute using its mutator.
protected mutateAttribute ( string $key, mixed $value ) : mixed
$key string
$value mixed
Результат mixed

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

Get a new query builder instance for the connection.
protected newBaseQueryBuilder ( ) : Builder
Результат LMongo\Query\Builder

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

Create a new Collection instance.
public newCollection ( array $models = [] ) : Collection
$models array
Результат Collection

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

Create a new model instance that is existing.
public newFromBuilder ( array $attributes = [] ) : Model
$attributes array
Результат Model

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

Create a new instance of the given model.
public newInstance ( array $attributes = [], boolean $exists = false ) : Model
$attributes array
$exists boolean
Результат Model

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

Get a new query builder for the model's table.
public newQuery ( boolean $excludeDeleted = true ) : Builder
$excludeDeleted boolean
Результат Builder

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

Get a new query builder that includes soft deletes.
public newQueryWithDeleted ( ) : Builder
Результат Illuminate\Database\Eloquent\Builder

observe() публичный статический Метод

Register an observer with the Model.
public static observe ( object $class ) : void
$class object
Результат void

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

Determine if the given attribute exists.
public offsetExists ( mixed $offset ) : boolean
$offset mixed
Результат boolean

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

Get the value for a given offset.
public offsetGet ( mixed $offset ) : mixed
$offset mixed
Результат mixed

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

Set the value for a given offset.
public offsetSet ( mixed $offset, mixed $value ) : void
$offset mixed
$value mixed
Результат void

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

Unset the value for a given offset.
public offsetUnset ( mixed $offset ) : void
$offset mixed
Результат void

on() публичный статический Метод

Begin querying the model on a given connection.
public static on ( string $connection = null ) : Builder
$connection string
Результат Builder

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

Get a new query builder that only includes soft deletes.
public static onlyTrashed ( ) : Builder
Результат Illuminate\Database\Eloquent\Builder

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

Perform the actual delete query on this model instance.
protected performDeleteOnModel ( ) : void
Результат void

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

Perform a model insert operation.
protected performInsert ( $query ) : boolean
Результат boolean

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

Perform a model update operation.
protected performUpdate ( $query ) : boolean
Результат boolean

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

Save the model and all of its relationships.
public push ( ) : boolean
Результат boolean

query() публичный статический Метод

Begin querying the model.
public static query ( ) : Builder
Результат Illuminate\Database\Eloquent\Builder

registerModelEvent() защищенный статический Метод

Register a model event with the dispatcher.
protected static registerModelEvent ( string $event, Closur\Closure | string $callback ) : void
$event string
$callback Closur\Closure | string
Результат void

reguard() публичный статический Метод

Enable the mass assignment restrictions.
public static reguard ( ) : void
Результат void

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

Get the model's relationships in array form.
public relationsToArray ( ) : array
Результат array

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

Clone the model into a new, non-existing instance.
public replicate ( ) : Model
Результат Model

resolveConnection() публичный статический Метод

Resolve a connection instance.
public static resolveConnection ( string $connection = null ) : Connection
$connection string
Результат LMongo\Connection

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

Restore a soft-deleted model instance.
public restore ( ) : boolean | null
Результат boolean | null

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

Save the model to the database.
public save ( ) : boolean
Результат boolean

saved() публичный статический Метод

Register a saved model event with the dispatcher.
public static saved ( Closur\Closure | string $callback ) : void
$callback Closur\Closure | string
Результат void

saving() публичный статический Метод

Register a saving model event with the dispatcher.
public static saving ( Closur\Closure | string $callback ) : void
$callback Closur\Closure | string
Результат void

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

Set a given attribute on the model.
public setAttribute ( string $key, mixed $value ) : void
$key string
$value mixed
Результат void

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

Set the connection associated with the model.
public setConnection ( string $name ) : void
$name string
Результат void

setConnectionResolver() публичный статический Метод

Set the connection resolver instance.
public static setConnectionResolver ( LMongo\ConnectionResolverInterface $resolver ) : void
$resolver LMongo\ConnectionResolverInterface
Результат void

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

Set the value of the "created at" attribute.
public setCreatedAt ( mixed $value ) : void
$value mixed
Результат void

setEventDispatcher() публичный статический Метод

Set the event dispatcher instance.
public static setEventDispatcher ( Illuminate\Events\Dispatcher $dispatcher ) : void
$dispatcher Illuminate\Events\Dispatcher
Результат void

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

Set the hidden attributes for the model.
public setHidden ( array $hidden ) : void
$hidden array
Результат void

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

Set whether IDs are incrementing.
public setIncrementing ( boolean $value ) : void
$value boolean
Результат void

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

Set the keys for a save update query.
protected setKeysForSaveQuery ( $query ) : Builder
Результат Builder

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

Set the number of models ot return per page.
public setPerPage ( integer $perPage ) : void
$perPage integer
Результат void

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

Set the array of model attributes. No checking is done.
public setRawAttributes ( array $attributes, boolean $sync = false ) : void
$attributes array
$sync boolean
Результат void

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

Set the specific relationship in the model.
public setRelation ( string $relation, mixed $value ) : Model
$relation string
$value mixed
Результат Model

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

Set the entire relations array on the model.
public setRelations ( array $relations ) : Model
$relations array
Результат Model

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

Set the soft deleting property on the model.
public setSoftDeleting ( boolean $enabled ) : void
$enabled boolean
Результат void

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

Set the relationships that are touched on save.
public setTouchedRelations ( array $touches ) : void
$touches array
Результат void

setUnguardState() публичный статический Метод

Set "unguard" to a given state.
public static setUnguardState ( boolean $state ) : void
$state boolean
Результат void

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

Set the value of the "updated at" attribute.
public setUpdatedAt ( mixed $value ) : void
$value mixed
Результат void

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

Set the visible attributes for the model.
public setVisible ( array $visible ) : void
$visible array
Результат void

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

Sync the original attributes with the current.
public syncOriginal ( ) : Model
Результат Model

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

Convert the model instance to an array.
public toArray ( ) : array
Результат array

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

Convert the model instance to JSON.
public toJson ( integer $options ) : string
$options integer
Результат string

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

Determine if the model is totally guarded.
public totallyGuarded ( ) : boolean
Результат boolean

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

Update the model's update timestamp.
public touch ( ) : boolean
Результат boolean

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

Touch the owning relations of the model.
public touchOwners ( ) : void
Результат void

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

Determine if the model touches a given relation.
public touches ( string $relation ) : boolean
$relation string
Результат boolean

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

Determine if the model instance has been soft-deleted.
public trashed ( ) : boolean
Результат boolean

unguard() публичный статический Метод

Disable all mass assignable restrictions.
public static unguard ( ) : void
Результат void

unsetEventDispatcher() публичный статический Метод

Unset the event dispatcher for models.
public static unsetEventDispatcher ( ) : void
Результат void

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

Update the model in the database.
public update ( array $attributes = [] ) : mixed
$attributes array
Результат mixed

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

Update the creation and update timestamps.
protected updateTimestamps ( ) : void
Результат void

updated() публичный статический Метод

Register an updated model event with the dispatcher.
public static updated ( Closur\Closure | string $callback ) : void
$callback Closur\Closure | string
Результат void

updating() публичный статический Метод

Register an updating model event with the dispatcher.
public static updating ( Closur\Closure | string $callback ) : void
$callback Closur\Closure | string
Результат void

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

Determine if the model uses timestamps.
public usesTimestamps ( ) : boolean
Результат boolean

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

Being querying a model with eager loading.
public static with ( array | string $relations ) : Builder
$relations array | string
Результат Builder

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

Get a new query builder that includes soft deletes.
public static withTrashed ( ) : Builder
Результат Illuminate\Database\Eloquent\Builder

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

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

The model's attributes.
protected array $attributes
Результат array

$booted защищенное статическое свойство

The array of booted models.
protected static array $booted
Результат array

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

The collection associated with the model.
protected string $collection
Результат string

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

The connection name for the model.
protected string $connection
Результат string

$dispatcher защищенное статическое свойство

The event dispatcher instance.
protected static Dispatcher,Illuminate\Events $dispatcher
Результат Illuminate\Events\Dispatcher

$exists публичное свойство

Indicates if the model exists.
public bool $exists
Результат boolean

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

The attributes that are mass assignable.
protected array $fillable
Результат array

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

The attributes that aren't mass assignable.
protected array $guarded
Результат array

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

The attributes that should be hidden for arrays.
protected array $hidden
Результат array

$incrementing публичное свойство

Indicates if the IDs are auto-incrementing.
public bool $incrementing
Результат boolean

$mutatorCache защищенное статическое свойство

The cache of the mutated attributes for each class.
protected static array $mutatorCache
Результат array

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

The model attribute's original state.
protected array $original
Результат array

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

The number of models to return for pagination.
protected int $perPage
Результат integer

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

The primary key for the model.
protected string $primaryKey
Результат string

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

The loaded relationships for the model.
protected array $relations
Результат array

$resolver защищенное статическое свойство

The connection resolver instance.
protected static ConnectionResolverInterface,LMongo $resolver
Результат LMongo\ConnectionResolverInterface

$snakeAttributes публичное статическое свойство

Indicates whether attributes are snake cased on arrays.
public static bool $snakeAttributes
Результат boolean

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

Indicates if the model should soft delete.
protected bool $softDelete
Результат boolean

$timestamps публичное свойство

Indicates if the model should be timestamped.
public bool $timestamps
Результат boolean

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

The relationships that should be touched on save.
protected array $touches
Результат array

$unguarded защищенное статическое свойство

Indicates if all mass assignment is enabled.
protected static bool $unguarded
Результат boolean

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

The attributes that should be visible in arrays.
protected arrays $visible
Результат arrays

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

The relations to eager load on every query.
protected array $with
Результат array