Entry
class Entry extends Model
Traits
Constants
CREATED_AT |
The name of the "created at" column. |
UPDATED_AT |
The name of the "updated at" column. |
Properties
protected string | $defaultOrderByField | Determines the default field to order the query by | from Queryable |
protected string | $defaultSortDirection | Determines the default direction to order the query by | from Queryable |
protected int | $perPage | The number of models to return for pagination. Also determines chunk size for LazyCollection | from Model |
protected bool | $useChunking | Determines if QueryableModel::all() calls in queries should chunk the result. | from QueryableModel |
bool | $exists | Indicates if the model exists. | from QueryableModel |
bool | $wasRecentlyCreated | Indicates if the model was inserted during the current request lifecycle. | from QueryableModel |
static protected array | $traitInitializers | The array of trait initializers that will be called on each new instance. | from QueryableModel |
static protected array | $booted | The array of booted models. | from QueryableModel |
protected string | $attributes | The interal storage of the model data. | from QueryableModel |
protected string | $relation | The relation associated with the model. | from Model |
protected int | $relationId | The directory_id associated with the model. | from Model |
protected string | $primaryField | The primary field for the model. | from QueryableModel |
protected string | $keyType | The "type" of the primary key ID. | from QueryableModel |
protected string | $resolvableField | The resolvable field associated with the model. | from Model |
bool | $incrementing | Indicates if the IDs are auto-incrementing. | from QueryableModel |
protected bool | $respectPublishingStatus | Indicates if we should respect the models publishing status when retrieving it. | from Model |
protected bool | $autoPublishes | Indicates if we should automatically publish the model on save. | from Model |
static protected Dispatcher | $dispatcher | The event dispatcher | from QueryableModel |
protected bool | $cachesResults | Determines if we should cache some results. | from Model |
protected bool | $hidesDefaultFields | Indicates if the model should hide default fields | from Model |
protected bool | $castsCustomFields | Indicates if the model should automatically resolve and cast the fields to the correct types | from Model |
protected string[] | $defaultFields | Indicates which fields are considered default fields | from Model |
bool | $timestamps | Indicates if the model should be timestamped. | from Model |
protected array | $dates | The attributes that should be mutated to dates. | from Model |
$hidden | The attributes that should be hidden for arrays. | from Model | |
int | $id | from Model | |
int | $directory_id | from Model | |
string | $name | from Model | |
string|null | $title | from Model | |
string | $url | from Model | |
int | $revision | from Model | |
string | $created | from Model | |
string | $updated | from Model | |
bool | $published | from Model | |
string|null | $author | from Model | |
int | $userid | from Model | |
bool | $use_time | from Model | |
string|null | $start | from Model | |
string|null | $stop | from Model | |
array | $tags | from Model | |
bool | $public | from Model | |
mixed | $authgroups | from Model | |
array | $variants | from Model |
Methods
Determine if this object respects publishing statuses when performing queries
Override the publishing status for the model
Perform an action and mutate the given key if $shouldCache is true
Cache the results with the given key if $shouldCache is true
Resolves an instance
Resolves an instance or throws an exception
Resolves multiple instances by their primary fields
Finds an instance by its primary field
Finds an instance by its primary field or throws an exception
Finds multiple instances by their primary fields
Retrieves a record by key
Inserts a new record, and returns its id
Updates a record
Create a new model instance that is existing.
Create a new instance of the given model.
Retrieves the first matching model or creates it
Retrieves the first model, or creates a new instance if not found
Perform an action with temporary disabled respectPublishingStatus
Perform any actions that are necessary after the model is saved.
Destroys one or multiple instances by primary key
Perform the actual delete query on this model instance.
Clone the model into a new, non-existing instance.
Updates an exisisting model or creates it
Retrieve the model for a bound value.
Retrieve the child model for a bound value.
Get the value indicating whether the IDs are incrementing.
Clear the list of booted models so they will be re-booted.
Handle dynamic static method calls into the method.
When a model is being unserialized, check if it needs to be booted.
Shim to make model compatible with HasAttributes trait
No description
Details
in
HasRelation at line 14
string
getRelation()
Gets the relation
in
HasRelation at line 24
int|null
getRelationId()
Gets the relation_id
in
HasRelation at line 36
protected string
getCacheIdentifier(mixed $identifier = null)
Creates a cacheKey
in
HasRelation at line 46
protected
getAllCacheIdentifier()
at line 12
protected Closure
getMapper()
in
Queryable at line 40
static protected Builder
makeQueryBuilder($appends = [])
in
Queryable at line 92
bool
respectPublishingStatus()
Determine if this object respects publishing statuses when performing queries
in
Queryable at line 103
static Builder
disregardingPublishingStatus(bool $disregarding = true)
Override the publishing status for the model
in
Queryable at line 117
static Builder
field(...$args)
Adds a field that should be retrieved
in
Queryable at line 130
static Builder
fields(...$args)
Sets which fields to retrieve (default: All fields)
in
Queryable at line 143
static Builder
limit(...$args)
Limits the results to $limit amount of hits
in
Queryable at line 158
static Builder
orderBy(...$args)
Sets the field which to order the results by
in
Queryable at line 171
static Builder
raw(...$args)
Performs a raw query, use carefully.
in
Queryable at line 189
static Builder
where(...$args)
Performs a 'where' query
If a closure is passed as the only argument, a new query scope will be created. If $value is omitted, $operator is used as the $value, and the $operator will be set to '='.
in
Queryable at line 203
static Builder
whereIn(...$args)
Queries where field exists in the values
in
Queryable at line 221
static Builder
whereNot(...$args)
Performs a 'whereNot' query
If a closure is passed as the only argument, a new query scope will be created. If $value is omitted, $operator is used as the $value, and the $operator will be set to '='.
in
Queryable at line 236
static
whereBetween(...$args)
in
Queryable at line 251
static
whereNotBetween(...$args)
in
Queryable at line 266
static PaginatedResult
paginate(...$args)
Creates a paginated result
in
Queryable at line 282
static mixed
maybeMutatesCache(string $key, bool $shouldCache, Closure $action)
Perform an action and mutate the given key if $shouldCache is true
in
Queryable at line 299
static Builder
maybeCacheResults(string $key, bool $shouldCache)
Cache the results with the given key if $shouldCache is true
in
Queryable at line 315
static Builder
cacheResults(string $key)
Cache the results with the given key
in
Queryable at line 328
static int
count(...$args)
Get the count of items matching the current query
in
Resolvable at line 20
protected
getPrimaryField()
in
Resolvable at line 25
protected
getResolvableField()
in
Resolvable at line 37
static protected mixed
resolvableContext(Closure $context)
Exectures the context if object can be resolved
in
Resolvable at line 53
static Resolvable|null
first()
Retrieves the first instance
in
Resolvable at line 69
static Resolvable
firstOrFail()
Retrieves the first instance or fails
in
Resolvable at line 85
static Resolvable|null
last()
Retrieves the latest instance
in
Resolvable at line 100
static Collection|LazyCollection
all()
Retrieves all instances
in
Resolvable at line 116
static
chunked($chunkSize = null)
in
Resolvable at line 142
static Resolvable|Collection|null
resolve(mixed $resolveBy, string|null $field = null)
Resolves an instance
in
Resolvable at line 163
static Resolvable|Collection
resolveOrFail(mixed $resolveBy)
Resolves an instance or throws an exception
in
Resolvable at line 180
static Collection
resolveMany(array $resolveBy)
Resolves multiple instances by their primary fields
in
Resolvable at line 193
static Resolvable|Collection|null
find(mixed|array|Collection $findBy)
Finds an instance by its primary field
in
Resolvable at line 220
static Resolvable|Collection
findOrFail(mixed|array $findBy)
Finds an instance by its primary field or throws an exception
in
Resolvable at line 237
static Collection
findMany(array $findBy)
Finds multiple instances by their primary fields
in
QueryableModel at line 179
__construct(array $attributes = [])
in
Model at line 178
protected array|null
performRetrieveRequest(int|null $relationId = null, mixed $key)
Retrieves a record by key
in
Model at line 190
protected mixed
performInsertRequest(int|null $relationId = null, array $attributes = [])
Inserts a new record, and returns its id
in
Model at line 205
protected void
performUpdateRequest(int|null $relationId = null, mixed $key, array $attributes = [])
Updates a record
in
Model at line 217
protected bool
performDeleteRequest(int|null $relationId = null, mixed $key)
Deletes a record
in
QueryableModel at line 241
QueryableModel|null
fresh()
Reload a fresh model instance from the database.
in
QueryableModel at line 267
QueryableModel
newFromBuilder(array $attributes = [])
Create a new model instance that is existing.
in
QueryableModel at line 284
static QueryableModel
create(array $attributes = [])
Saves a new model
in
QueryableModel at line 300
QueryableModel
newInstance(array $attributes = [], bool $exists = false)
Create a new instance of the given model.
in
QueryableModel at line 313
array
getTagsAttribute(string|null $tags = null)
in
QueryableModel at line 322
void
setTagsAttribute(array $tags = [])
in
QueryableModel at line 334
static QueryableModel
firstOrCreate(array $query, array $with = [])
Retrieves the first matching model or creates it
in
QueryableModel at line 359
static QueryableModel
firstOrNew(array $attributes = [])
Retrieves the first model, or creates a new instance if not found
in
QueryableModel at line 373
protected bool
performUpdate()
Perform a model update operation.
in
QueryableModel at line 412
protected mixed
withIgnoredPublishingStatus(callable $callback)
Perform an action with temporary disabled respectPublishingStatus
in
QueryableModel at line 427
protected bool
performInsert()
Perform a model insert operation.
in
QueryableModel at line 463
$this
syncOriginal()
Sync the original attributes with the current.
in
QueryableModel at line 476
protected void
finishSave()
Perform any actions that are necessary after the model is saved.
in
QueryableModel at line 488
bool
save()
Updates or stores the model
in
QueryableModel at line 515
bool|null
delete()
Delete the model from the database.
in
QueryableModel at line 540
static bool
destroy(mixed|array|Collection ...$identifiers)
Destroys one or multiple instances by primary key
in
QueryableModel at line 559
protected void
performDeleteOnModel()
Perform the actual delete query on this model instance.
in
QueryableModel at line 575
QueryableModel
replicate(array $except = null)
Clone the model into a new, non-existing instance.
in
QueryableModel at line 600
array
jsonSerialize()
Convert the object into something JSON serializable.
in
QueryableModel at line 611
bool
update(array $attributes = [])
Update the model
in
QueryableModel at line 627
static QueryableModel
updateOrCreate(array $query, array $with = [])
Updates an exisisting model or creates it
in
QueryableModel at line 655
$this
fill(array $attributes)
Fill the model with an array of attributes.
in
QueryableModel at line 678
bool
is(QueryableModel $other)
in
QueryableModel at line 688
array
toArray()
Convert the model instance to an array.
in
QueryableModel at line 701
string
toJson(int $options = 0)
Convert the model instance to JSON.
in
QueryableModel at line 717
mixed
getRouteKey()
Get the value of the model's route key.
in
QueryableModel at line 727
string
getRouteKeyName()
Get the route key for the model.
in
Model at line 243
Model|null
resolveRouteBinding(mixed $rawValue, string|null $field = null)
Retrieve the model for a bound value.
in
QueryableModel at line 781
Model|null
resolveChildRouteBinding(string $childType, mixed $value, string|null $field)
Retrieve the child model for a bound value.
in
QueryableModel at line 791
bool
getIncrementing()
Get the value indicating whether the IDs are incrementing.
in
QueryableModel at line 800
bool
offsetExists(mixed $offset)
in
QueryableModel at line 809
mixed
offsetGet(mixed $offset)
in
QueryableModel at line 819
void
offsetSet(mixed $offset, mixed $value)
in
QueryableModel at line 828
void
offsetUnset(mixed $offset)
in
QueryableModel at line 838
protected void
bootIfNotBooted()
Check if the model needs to be booted and if so, do it.
in
QueryableModel at line 855
static protected void
boot()
Bootstrap the model and its traits.
in
QueryableModel at line 865
static protected void
bootTraits()
Boot all of the bootable traits on the model.
in
QueryableModel at line 891
mixed
__get(string $key)
Dynamically retrieve attributes on the model.
in
QueryableModel at line 903
void
__set(string $key, mixed $value)
Dynamically set attributes on the model.
in
QueryableModel at line 913
protected void
initializeTraits()
Initialize any initializable traits on the model.
in
QueryableModel at line 925
mixed
getKey()
Get the value of the model's primary key.
in
QueryableModel at line 935
string
getKeyName()
Get the primary key for the model.
in
QueryableModel at line 946
$this
setKeyName(string $key)
Set the primary key for the model.
in
QueryableModel at line 958
string
getKeyType()
Get the auto-incrementing key type.
in
QueryableModel at line 969
$this
setKeyType(string $type)
Set the data type for the primary key.
in
QueryableModel at line 981
static void
clearBootedModels()
Clear the list of booted models so they will be re-booted.
in
QueryableModel at line 993
static mixed
__callStatic(string $method, array $parameters)
Handle dynamic static method calls into the method.
in
QueryableModel at line 1003
string
__toString()
Convert the model to its string representation.
in
QueryableModel at line 1013
void
__wakeup()
When a model is being unserialized, check if it needs to be booted.
in
QueryableModel at line 1024
static protected void
booting(Closure|string $callback)
Register a booting model event with the dispatcher.
in
QueryableModel at line 1037
static protected void
booted(Closure|string $callback)
Register a booted model event with the dispatcher.
in
QueryableModel at line 1050
protected bool
relationLoaded(string $key)
Shim to make model compatible with HasAttributes trait
in
QueryableModel at line 1059
bool
__isset(string $key)
in
QueryableModel at line 1067
array
__debugInfo()
in
CastsDefaultFields at line 15
static array
customFieldCasts(Model $model)
in
CastsDefaultFields at line 32
static
bootCastsDefaultFields()
in
HidesDefaultFields at line 7
static
bootHidesDefaultFields()
at line 29
Structure|null
getStructureAttribute()
in
Model at line 270
static bool
register()
Register the model