PHP Class LMongo\Eloquent\Model

Inheritance: implements ArrayAcces\ArrayAccess, implements Illuminate\Support\Contracts\ArrayableInterface, implements Illuminate\Support\Contracts\JsonableInterface
Afficher le fichier Open project: navruzm/lmongo Class Usage Examples

Méthodes publiques

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

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

Méthodes publiques

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

Méthodes protégées

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

Method Details

__call() public méthode

Handle dynamic method calls into the method.
public __call ( string $method, array $parameters ) : mixed
$method string
$parameters array
Résultat mixed

__callStatic() public static méthode

Handle dynamic static method calls into the method.
public static __callStatic ( string $method, array $parameters ) : mixed
$method string
$parameters array
Résultat mixed

__construct() public méthode

Create a new Eloquent model instance.
public __construct ( array $attributes = [] ) : void
$attributes array
Résultat void

__get() public méthode

Dynamically retrieve attributes on the model.
public __get ( string $key ) : mixed
$key string
Résultat mixed

__isset() public méthode

Determine if an attribute exists on the model.
public __isset ( string $key ) : void
$key string
Résultat void

__set() public méthode

Dynamically set attributes on the model.
public __set ( string $key, mixed $value ) : void
$key string
$value mixed
Résultat void

__toString() public méthode

Convert the model to its string representation.
public __toString ( ) : string
Résultat string

__unset() public méthode

Unset an attribute on the model.
public __unset ( string $key ) : void
$key string
Résultat void

all() public static méthode

Get all of the models from the database.
public static all ( array $columns = [] ) : Collection
$columns array
Résultat Collection

asDateTime() protected méthode

Return a timestamp as DateTime object.
protected asDateTime ( mixed $value ) : DateTime
$value mixed
Résultat DateTime

attributesToArray() public méthode

Convert the model's attributes to an array.
public attributesToArray ( ) : array
Résultat array

belongsTo() public méthode

Define an inverse one-to-one or many relationship.
public belongsTo ( string $related, string $foreignKey = null ) : BelongsTo
$related string
$foreignKey string
Résultat LMongo\Eloquent\Relations\BelongsTo

belongsToMany() public méthode

Define a many-to-many relationship.
public belongsToMany ( string $related, string $foreignKey = null, string $otherKey = null ) : BelongsToMany
$related string
$foreignKey string
$otherKey string
Résultat LMongo\Eloquent\Relations\BelongsToMany

boot() protected static méthode

The "booting" method of the model.
protected static boot ( ) : void
Résultat void

collection() public méthode

Set the collection associated with the model.
public collection ( string $collection ) : void
$collection string
Résultat void

create() public static méthode

Save a new model and return the instance.
public static create ( array $attributes ) : Model
$attributes array
Résultat Model

created() public static méthode

Register a created model event with the dispatcher.
public static created ( Closur\Closure | string $callback ) : void
$callback Closur\Closure | string
Résultat void

creating() public static méthode

Register a creating model event with the dispatcher.
public static creating ( Closur\Closure | string $callback ) : void
$callback Closur\Closure | string
Résultat void

decrement() protected méthode

Decrement a column's value by a given amount.
protected decrement ( string $column, integer $amount = 1 ) : integer
$column string
$amount integer
Résultat integer

delete() public méthode

Delete the model from the database.
public delete ( ) : boolean | null
Résultat boolean | null

deleted() public static méthode

Register a deleted model event with the dispatcher.
public static deleted ( Closur\Closure | string $callback ) : void
$callback Closur\Closure | string
Résultat void

deleting() public static méthode

Register a deleting model event with the dispatcher.
public static deleting ( Closur\Closure | string $callback ) : void
$callback Closur\Closure | string
Résultat void

destroy() public static méthode

Destroy the models for the given IDs.
public static destroy ( array | integer $ids ) : void
$ids array | integer
Résultat void

fill() public méthode

Fill the model with an array of attributes.
public fill ( array $attributes ) : Model
$attributes array
Résultat Model

fillable() public méthode

Set the fillable attributes for the model.
public fillable ( array $fillable ) : Model
$fillable array
Résultat Model

find() public static méthode

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

findOrFail() public static méthode

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

finishSave() protected méthode

Finish processing on a successful save operation.
protected finishSave ( ) : void
Résultat void

fireModelEvent() protected méthode

Fire the given event for the model.
protected fireModelEvent ( string $event, boolean $halt = true ) : mixed
$event string
$halt boolean
Résultat mixed

flushEventListeners() public static méthode

Remove all of the event listeners for the model.
public static flushEventListeners ( ) : void
Résultat void

forceDelete() public méthode

Force a hard delete on a soft deleted model.
public forceDelete ( ) : void
Résultat void

freshTimestamp() public méthode

Get a fresh MongoDate for the model.
public freshTimestamp ( ) : MongoDate
Résultat MongoDate

fromDateTime() protected méthode

Convert a DateTime to a storable string.
protected fromDateTime ( DateTim\DateTime | integer $value ) : string
$value DateTim\DateTime | integer
Résultat string

getArrayableAttributes() protected méthode

Get an attribute array of all arrayable attributes.
protected getArrayableAttributes ( ) : array
Résultat array

getAttribute() public méthode

Get an attribute from the model.
public getAttribute ( string $key ) : mixed
$key string
Résultat mixed

getAttributeFromArray() protected méthode

Get an attribute from the $attributes array.
protected getAttributeFromArray ( string $key ) : mixed
$key string
Résultat mixed

getAttributeValue() protected méthode

Get a plain attribute (not a relationship).
protected getAttributeValue ( string $key ) : mixed
$key string
Résultat mixed

getAttributes() public méthode

Get all of the current attributes on the model.
public getAttributes ( ) : array
Résultat array

getCollection() public méthode

Get the collection associated with the model.
public getCollection ( ) : string
Résultat string

getConnection() public méthode

Get the database connection for the model.
public getConnection ( ) : Connection
Résultat LMongo\Connection

getConnectionName() public méthode

Get the current connection name for the model.
public getConnectionName ( ) : string
Résultat string

getConnectionResolver() public static méthode

Get the connection resolver instance.
public static getConnectionResolver ( ) : LMongo\ConnectionResolverInterface
Résultat LMongo\ConnectionResolverInterface

getCreatedAtColumn() public méthode

Get the name of the "created at" column.
public getCreatedAtColumn ( ) : string
Résultat string

getDateFormat() protected méthode

Get the format for database stored dates.
protected getDateFormat ( ) : string
Résultat string

getDates() public méthode

Get the attributes that should be converted to dates.
public getDates ( ) : array
Résultat array

getDeletedAtColumn() public méthode

Get the name of the "deleted at" column.
public getDeletedAtColumn ( ) : string
Résultat string

getDirty() public méthode

Get the attributes that have been changed since last sync.
public getDirty ( ) : array
Résultat array

getEventDispatcher() public static méthode

Get the event dispatcher instance.
public static getEventDispatcher ( ) : Illuminate\Events\Dispatcher
Résultat Illuminate\Events\Dispatcher

getFillable() public méthode

Get the fillable attributes for the model.
public getFillable ( ) : array
Résultat array

getForeignKey() public méthode

Get the default foreign key name for the model.
public getForeignKey ( ) : string
Résultat string

getHidden() public méthode

Get the hidden attributes for the model.
public getHidden ( ) : array
Résultat array

getIncrementing() public méthode

Get the value indicating whether the IDs are incrementing.
public getIncrementing ( ) : boolean
Résultat boolean

getKey() public méthode

Get the value of the model's primary key.
public getKey ( ) : mixed
Résultat mixed

getKeyName() public méthode

Get the primary key for the model.
public getKeyName ( ) : string
Résultat string

getMorphs() protected méthode

Get the polymorphic relationship columns.
protected getMorphs ( string $name, string $type, string $id ) : array
$name string
$type string
$id string
Résultat array

getMutatedAttributes() public méthode

Get the mutated attributes for a given instance.
public getMutatedAttributes ( ) : array
Résultat array

getObservableEvents() public méthode

Get the observable event names.
public getObservableEvents ( ) : array
Résultat array

getOriginal() public méthode

Get the model's original attribute values.
public getOriginal ( string $key = null, mixed $default = null ) : array
$key string
$default mixed
Résultat array

getPerPage() public méthode

Get the number of models to return per page.
public getPerPage ( ) : integer
Résultat integer

getQualifiedDeletedAtColumn() public méthode

Get the fully qualified "deleted at" column.
public getQualifiedDeletedAtColumn ( ) : string
Résultat string

getRelation() public méthode

Get a specified relationship.
public getRelation ( string $relation ) : mixed
$relation string
Résultat mixed

getRelations() public méthode

Get all the loaded relations for the instance.
public getRelations ( ) : array
Résultat array

getTouchedRelations() public méthode

Get the relationships that are touched on save.
public getTouchedRelations ( ) : array
Résultat array

getUpdatedAtColumn() public méthode

Get the name of the "updated at" column.
public getUpdatedAtColumn ( ) : string
Résultat string

guard() public méthode

Set the guarded attributes for the model.
public guard ( array $guarded ) : Model
$guarded array
Résultat Model

hasGetMutator() public méthode

Determine if a get mutator exists for an attribute.
public hasGetMutator ( string $key ) : boolean
$key string
Résultat boolean

hasMany() public méthode

Define a one-to-many relationship.
public hasMany ( string $related, string $foreignKey = null ) : HasMany
$related string
$foreignKey string
Résultat LMongo\Eloquent\Relations\HasMany

hasOne() public méthode

Define a one-to-one relationship.
public hasOne ( string $related, string $foreignKey = null ) : LMongo\Eloquent\Relation\HasOne
$related string
$foreignKey string
Résultat LMongo\Eloquent\Relation\HasOne

hasSetMutator() public méthode

Determine if a set mutator exists for an attribute.
public hasSetMutator ( string $key ) : boolean
$key string
Résultat boolean

increment() protected méthode

Increment a column's value by a given amount.
protected increment ( string $column, integer $amount = 1 ) : integer
$column string
$amount integer
Résultat integer

incrementOrDecrement() protected méthode

Run the increment or decrement method on the model.
protected incrementOrDecrement ( string $column, integer $amount, string $method ) : integer
$column string
$amount integer
$method string
Résultat integer

insertAndSetId() protected méthode

Insert the given attributes and set the ID on the model.
protected insertAndSetId ( Builder $query, array $attributes ) : void
$query Builder
$attributes array
Résultat void

isDirty() public méthode

Determine if a given attribute is dirty.
public isDirty ( string $attribute ) : boolean
$attribute string
Résultat boolean

isFillable() public méthode

Determine if the given attribute may be mass assigned.
public isFillable ( string $key ) : boolean
$key string
Résultat boolean

isGuarded() public méthode

Determine if the given key is guarded.
public isGuarded ( string $key ) : boolean
$key string
Résultat boolean

isSoftDeleting() public méthode

Determine if the model instance uses soft deletes.
public isSoftDeleting ( ) : boolean
Résultat boolean

load() public méthode

Eager load relations on the model.
public load ( array | string $relations ) : void
$relations array | string
Résultat void

morphMany() public méthode

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
Résultat LMongo\Eloquent\Relation\MorphMany

morphOne() public méthode

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
Résultat LMongo\Eloquent\Relation\MorphOne

morphTo() public méthode

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
Résultat LMongo\Eloquent\Relations\BelongsTo

mutateAttribute() protected méthode

Get the value of an attribute using its mutator.
protected mutateAttribute ( string $key, mixed $value ) : mixed
$key string
$value mixed
Résultat mixed

newBaseQueryBuilder() protected méthode

Get a new query builder instance for the connection.
protected newBaseQueryBuilder ( ) : Builder
Résultat LMongo\Query\Builder

newCollection() public méthode

Create a new Collection instance.
public newCollection ( array $models = [] ) : Collection
$models array
Résultat Collection

newFromBuilder() public méthode

Create a new model instance that is existing.
public newFromBuilder ( array $attributes = [] ) : Model
$attributes array
Résultat Model

newInstance() public méthode

Create a new instance of the given model.
public newInstance ( array $attributes = [], boolean $exists = false ) : Model
$attributes array
$exists boolean
Résultat Model

newQuery() public méthode

Get a new query builder for the model's table.
public newQuery ( boolean $excludeDeleted = true ) : Builder
$excludeDeleted boolean
Résultat Builder

newQueryWithDeleted() public méthode

Get a new query builder that includes soft deletes.
public newQueryWithDeleted ( ) : Builder
Résultat Illuminate\Database\Eloquent\Builder

observe() public static méthode

Register an observer with the Model.
public static observe ( object $class ) : void
$class object
Résultat void

offsetExists() public méthode

Determine if the given attribute exists.
public offsetExists ( mixed $offset ) : boolean
$offset mixed
Résultat boolean

offsetGet() public méthode

Get the value for a given offset.
public offsetGet ( mixed $offset ) : mixed
$offset mixed
Résultat mixed

offsetSet() public méthode

Set the value for a given offset.
public offsetSet ( mixed $offset, mixed $value ) : void
$offset mixed
$value mixed
Résultat void

offsetUnset() public méthode

Unset the value for a given offset.
public offsetUnset ( mixed $offset ) : void
$offset mixed
Résultat void

on() public static méthode

Begin querying the model on a given connection.
public static on ( string $connection = null ) : Builder
$connection string
Résultat Builder

onlyTrashed() public static méthode

Get a new query builder that only includes soft deletes.
public static onlyTrashed ( ) : Builder
Résultat Illuminate\Database\Eloquent\Builder

performDeleteOnModel() protected méthode

Perform the actual delete query on this model instance.
protected performDeleteOnModel ( ) : void
Résultat void

performInsert() protected méthode

Perform a model insert operation.
protected performInsert ( $query ) : boolean
Résultat boolean

performUpdate() protected méthode

Perform a model update operation.
protected performUpdate ( $query ) : boolean
Résultat boolean

push() public méthode

Save the model and all of its relationships.
public push ( ) : boolean
Résultat boolean

query() public static méthode

Begin querying the model.
public static query ( ) : Builder
Résultat Illuminate\Database\Eloquent\Builder

registerModelEvent() protected static méthode

Register a model event with the dispatcher.
protected static registerModelEvent ( string $event, Closur\Closure | string $callback ) : void
$event string
$callback Closur\Closure | string
Résultat void

reguard() public static méthode

Enable the mass assignment restrictions.
public static reguard ( ) : void
Résultat void

relationsToArray() public méthode

Get the model's relationships in array form.
public relationsToArray ( ) : array
Résultat array

replicate() public méthode

Clone the model into a new, non-existing instance.
public replicate ( ) : Model
Résultat Model

resolveConnection() public static méthode

Resolve a connection instance.
public static resolveConnection ( string $connection = null ) : Connection
$connection string
Résultat LMongo\Connection

restore() public méthode

Restore a soft-deleted model instance.
public restore ( ) : boolean | null
Résultat boolean | null

save() public méthode

Save the model to the database.
public save ( ) : boolean
Résultat boolean

saved() public static méthode

Register a saved model event with the dispatcher.
public static saved ( Closur\Closure | string $callback ) : void
$callback Closur\Closure | string
Résultat void

saving() public static méthode

Register a saving model event with the dispatcher.
public static saving ( Closur\Closure | string $callback ) : void
$callback Closur\Closure | string
Résultat void

setAttribute() public méthode

Set a given attribute on the model.
public setAttribute ( string $key, mixed $value ) : void
$key string
$value mixed
Résultat void

setConnection() public méthode

Set the connection associated with the model.
public setConnection ( string $name ) : void
$name string
Résultat void

setConnectionResolver() public static méthode

Set the connection resolver instance.
public static setConnectionResolver ( LMongo\ConnectionResolverInterface $resolver ) : void
$resolver LMongo\ConnectionResolverInterface
Résultat void

setCreatedAt() public méthode

Set the value of the "created at" attribute.
public setCreatedAt ( mixed $value ) : void
$value mixed
Résultat void

setEventDispatcher() public static méthode

Set the event dispatcher instance.
public static setEventDispatcher ( Illuminate\Events\Dispatcher $dispatcher ) : void
$dispatcher Illuminate\Events\Dispatcher
Résultat void

setHidden() public méthode

Set the hidden attributes for the model.
public setHidden ( array $hidden ) : void
$hidden array
Résultat void

setIncrementing() public méthode

Set whether IDs are incrementing.
public setIncrementing ( boolean $value ) : void
$value boolean
Résultat void

setKeysForSaveQuery() protected méthode

Set the keys for a save update query.
protected setKeysForSaveQuery ( $query ) : Builder
Résultat Builder

setPerPage() public méthode

Set the number of models ot return per page.
public setPerPage ( integer $perPage ) : void
$perPage integer
Résultat void

setRawAttributes() public méthode

Set the array of model attributes. No checking is done.
public setRawAttributes ( array $attributes, boolean $sync = false ) : void
$attributes array
$sync boolean
Résultat void

setRelation() public méthode

Set the specific relationship in the model.
public setRelation ( string $relation, mixed $value ) : Model
$relation string
$value mixed
Résultat Model

setRelations() public méthode

Set the entire relations array on the model.
public setRelations ( array $relations ) : Model
$relations array
Résultat Model

setSoftDeleting() public méthode

Set the soft deleting property on the model.
public setSoftDeleting ( boolean $enabled ) : void
$enabled boolean
Résultat void

setTouchedRelations() public méthode

Set the relationships that are touched on save.
public setTouchedRelations ( array $touches ) : void
$touches array
Résultat void

setUnguardState() public static méthode

Set "unguard" to a given state.
public static setUnguardState ( boolean $state ) : void
$state boolean
Résultat void

setUpdatedAt() public méthode

Set the value of the "updated at" attribute.
public setUpdatedAt ( mixed $value ) : void
$value mixed
Résultat void

setVisible() public méthode

Set the visible attributes for the model.
public setVisible ( array $visible ) : void
$visible array
Résultat void

syncOriginal() public méthode

Sync the original attributes with the current.
public syncOriginal ( ) : Model
Résultat Model

toArray() public méthode

Convert the model instance to an array.
public toArray ( ) : array
Résultat array

toJson() public méthode

Convert the model instance to JSON.
public toJson ( integer $options ) : string
$options integer
Résultat string

totallyGuarded() public méthode

Determine if the model is totally guarded.
public totallyGuarded ( ) : boolean
Résultat boolean

touch() public méthode

Update the model's update timestamp.
public touch ( ) : boolean
Résultat boolean

touchOwners() public méthode

Touch the owning relations of the model.
public touchOwners ( ) : void
Résultat void

touches() public méthode

Determine if the model touches a given relation.
public touches ( string $relation ) : boolean
$relation string
Résultat boolean

trashed() public méthode

Determine if the model instance has been soft-deleted.
public trashed ( ) : boolean
Résultat boolean

unguard() public static méthode

Disable all mass assignable restrictions.
public static unguard ( ) : void
Résultat void

unsetEventDispatcher() public static méthode

Unset the event dispatcher for models.
public static unsetEventDispatcher ( ) : void
Résultat void

update() public méthode

Update the model in the database.
public update ( array $attributes = [] ) : mixed
$attributes array
Résultat mixed

updateTimestamps() protected méthode

Update the creation and update timestamps.
protected updateTimestamps ( ) : void
Résultat void

updated() public static méthode

Register an updated model event with the dispatcher.
public static updated ( Closur\Closure | string $callback ) : void
$callback Closur\Closure | string
Résultat void

updating() public static méthode

Register an updating model event with the dispatcher.
public static updating ( Closur\Closure | string $callback ) : void
$callback Closur\Closure | string
Résultat void

usesTimestamps() public méthode

Determine if the model uses timestamps.
public usesTimestamps ( ) : boolean
Résultat boolean

with() public static méthode

Being querying a model with eager loading.
public static with ( array | string $relations ) : Builder
$relations array | string
Résultat Builder

withTrashed() public static méthode

Get a new query builder that includes soft deletes.
public static withTrashed ( ) : Builder
Résultat Illuminate\Database\Eloquent\Builder

Property Details

$attributes protected_oe property

The model's attributes.
protected array $attributes
Résultat array

$booted protected_oe static_oe property

The array of booted models.
protected static array $booted
Résultat array

$collection protected_oe property

The collection associated with the model.
protected string $collection
Résultat string

$connection protected_oe property

The connection name for the model.
protected string $connection
Résultat string

$dispatcher protected_oe static_oe property

The event dispatcher instance.
protected static Dispatcher,Illuminate\Events $dispatcher
Résultat Illuminate\Events\Dispatcher

$exists public_oe property

Indicates if the model exists.
public bool $exists
Résultat boolean

$fillable protected_oe property

The attributes that are mass assignable.
protected array $fillable
Résultat array

$guarded protected_oe property

The attributes that aren't mass assignable.
protected array $guarded
Résultat array

$hidden protected_oe property

The attributes that should be hidden for arrays.
protected array $hidden
Résultat array

$incrementing public_oe property

Indicates if the IDs are auto-incrementing.
public bool $incrementing
Résultat boolean

$mutatorCache protected_oe static_oe property

The cache of the mutated attributes for each class.
protected static array $mutatorCache
Résultat array

$original protected_oe property

The model attribute's original state.
protected array $original
Résultat array

$perPage protected_oe property

The number of models to return for pagination.
protected int $perPage
Résultat integer

$primaryKey protected_oe property

The primary key for the model.
protected string $primaryKey
Résultat string

$relations protected_oe property

The loaded relationships for the model.
protected array $relations
Résultat array

$resolver protected_oe static_oe property

The connection resolver instance.
protected static ConnectionResolverInterface,LMongo $resolver
Résultat LMongo\ConnectionResolverInterface

$snakeAttributes public_oe static_oe property

Indicates whether attributes are snake cased on arrays.
public static bool $snakeAttributes
Résultat boolean

$softDelete protected_oe property

Indicates if the model should soft delete.
protected bool $softDelete
Résultat boolean

$timestamps public_oe property

Indicates if the model should be timestamped.
public bool $timestamps
Résultat boolean

$touches protected_oe property

The relationships that should be touched on save.
protected array $touches
Résultat array

$unguarded protected_oe static_oe property

Indicates if all mass assignment is enabled.
protected static bool $unguarded
Résultat boolean

$visible protected_oe property

The attributes that should be visible in arrays.
protected arrays $visible
Résultat arrays

$with protected_oe property

The relations to eager load on every query.
protected array $with
Résultat array