Menu_categories_model
class Menu_categories_model extends Model
Menu categories Model Class
Traits
Extendable Trait Allows for "Private traits"
Adds event related features to any class.
Properties
protected array | $extensionData | from ExtendableTrait | |
static protected array | $extendableCallbacks | from ExtendableTrait | |
static protected array | $extendableStaticMethods | from ExtendableTrait | |
static protected bool | $extendableGuardProperties | from ExtendableTrait | |
static protected ClassLoader | $extendableClassLoader | from ExtendableTrait | |
protected array | $emitterSingleEvents | from EventEmitter | |
protected array | $emitterEvents | from EventEmitter | |
protected array | $emitterEventSorted | from EventEmitter | |
$relation | |||
static protected array | $relationTypes | from HasRelationships | |
array | $implement | from Model | |
protected array | $attributes | from Model | |
$timestamps | from Model | ||
protected string | $timeFormat | The storage format of the model's time columns. |
from Model |
protected | $casts | ||
static protected array | $eventsBooted | from Model | |
static protected string[] | $primitiveCastTypes | The built-in, primitive cast types supported by Eloquent. |
from Model |
protected string | $table | ||
string | $incrementing |
Methods
Helper method for ::extend() static method
Clear the list of extended classes so they will be re-extended.
Normalizes the provided extension name allowing for the ClassLoader to inject aliased classes
Dynamically extend a class with a specified behavior
Extracts the available methods from a behavior and adds it to the list of callable methods.
Programmatically adds a method to the extendable class
Programatically adds a property to the extendable class
Check if extendable class is extended with a behavior object
Returns a behavior object from an extendable class, example:
Short hand for getClassExtension() method, except takes the short extension name, example:
Checks if a method exists, extension equivalent of method_exists()
Get a list of class methods, extension equivalent of get_class_methods()
Checks if a property exists, extension equivalent of property_exists()
Checks if a property is accessible, property equivalent of is_callabe()
Magic method for __call()
Magic method for __callStatic()
Create a new event binding.
Create a new event binding that fires once only
Sort the listeners for a given event by priority.
Fire an event and call the listeners.
Fires a combination of local and global events. The first segment is removed from the event name locally and the local object is passed as the first argument to the event globally. Halting is also enabled by default.
Set a given attribute on the model.
Determine whether a value is Time castable for inbound manipulation.
Set the time format used by the model.
Returns relationship details from a supplied name.
Returns relationship details for all relations defined on this model.
Returns a relationship type based on a supplied name.
Sets a relation value directly from its attribute.
Determines whether the specified relation should be saved when push() is called instead of save() on the model. Default: true.
Returns default relation arguments for a given type.
Validate relation supplied arguments.
Define a one-to-one relationship.
Define a has-one-through relationship.
Define a one-to-many relationship.
Define a has-many-through relationship.
No description
No description
Define a polymorphic one-to-one relationship.
Define a polymorphic, inverse one-to-one or many relationship.
Define a polymorphic, inverse one-to-one or many relationship.
Define a polymorphic one-to-many relationship.
Define a polymorphic many-to-many relationship.
Define a polymorphic, inverse many-to-many relationship.
Create a new model and return the instance.
Save a new model and return the instance.
Bind some nicer events to this model, in the format of method overrides.
Remove all of the event listeners for the model Also flush registry of models that had events booted Allows painless unit testing.
Create a new model instance that is existing.
Create a new Eloquent query builder for the model.
Create a generic pivot model instance.
Create a pivot model instance specific to a relation.
Save the model to the database.
Save the model and all of its relationships.
Pushes the first level of relations even if the parent model has no changes.
Locates relations with delete flag and cascades the delete event.
Details
in
ExtendableTrait at line 55
extendableConstruct()
Constructor.
in
ExtendableTrait at line 103
static void
extendableExtendCallback(callable $callback)
Helper method for ::extend() static method
in
ExtendableTrait at line 120
static void
clearExtendedClasses()
Clear the list of extended classes so they will be re-extended.
in
ExtendableTrait at line 131
protected string
extensionNormalizeClassName(string $name)
Normalizes the provided extension name allowing for the ClassLoader to inject aliased classes
in
ExtendableTrait at line 149
void|ExtendableTrait
extendClassWith(string $extensionName)
Dynamically extend a class with a specified behavior
in
ExtendableTrait at line 178
protected void
extensionExtractMethods(string $extensionName, object $extensionObject)
Extracts the available methods from a behavior and adds it to the list of callable methods.
in
ExtendableTrait at line 206
addDynamicMethod(string $dynamicName, callable $method, string $extension = null)
Programmatically adds a method to the extendable class
in
ExtendableTrait at line 225
addDynamicProperty(string $dynamicName, string $value = null)
Programatically adds a property to the extendable class
in
ExtendableTrait at line 249
bool
isClassExtendedWith(string $name)
Check if extendable class is extended with a behavior object
in
ExtendableTrait at line 265
mixed
getClassExtension(string $name)
Returns a behavior object from an extendable class, example:
$this->getClassExtension('Admin.Actions.FormController')
in
ExtendableTrait at line 280
mixed
asExtension(string $shortName)
Short hand for getClassExtension() method, except takes the short extension name, example:
$this->asExtension('FormController')
in
ExtendableTrait at line 301
bool
methodExists(string $name)
Checks if a method exists, extension equivalent of method_exists()
in
ExtendableTrait at line 313
array
getClassMethods()
Get a list of class methods, extension equivalent of get_class_methods()
in
ExtendableTrait at line 326
array
getDynamicProperties()
Returns all dynamic properties and their values
in
ExtendableTrait at line 344
bool
propertyExists(string $name)
Checks if a property exists, extension equivalent of property_exists()
in
ExtendableTrait at line 370
protected bool
extendableIsAccessible(mixed $class, string $propertyName)
Checks if a property is accessible, property equivalent of is_callabe()
in
ExtendableTrait at line 385
string
extendableGet(string $name)
Magic method for __get()
in
ExtendableTrait at line 410
string
extendableSet(string $name, string $value)
Magic method for __set()
in
ExtendableTrait at line 444
mixed
extendableCall(string $name, array $params = null)
Magic method for __call()
in
ExtendableTrait at line 483
static mixed
extendableCallStatic(string $name, array $params = null)
Magic method for __callStatic()
in
ExtendableTrait at line 552
protected ClassLoader|null
extensionGetClassLoader()
Gets the class loader
in
EventEmitter at line 36
EventEmitter
bindEvent(string $event, callable $callback, int $priority = 0)
Create a new event binding.
in
EventEmitter at line 52
EventEmitter
bindEventOnce(string $event, callable $callback)
Create a new event binding that fires once only
in
EventEmitter at line 66
protected void
emitterEventSortEvents(string $eventName)
Sort the listeners for a given event by priority.
in
EventEmitter at line 84
EventEmitter
unbindEvent(string $event = null)
Destroys an event binding.
in
EventEmitter at line 124
string|array
fireEvent(string $event, array $params = [], bool $halt = false)
Fire an event and call the listeners.
in
EventEmitter at line 178
mixed
fireSystemEvent(string $event, array $params = [], bool $halt = true)
Fires a combination of local and global events. The first segment is removed from the event name locally and the local object is passed as the first argument to the event globally. Halting is also enabled by default.
For example:
$this->fireSystemEvent('admin.form.myEvent', ['my value']);
Is equivalent to:
$this->fireEvent('form.myEvent', ['myvalue'], true);
Event::fire('admin.form.myEvent', [$this, 'myvalue'], true);
in
HasAttributes at line 19
void
addCasts(array $attributes)
Add attribute casts for the model.
in
HasAttributes at line 24
getAttribute($key)
No description
in
HasAttributes at line 46
getAttributeValue($key)
No description
in
HasAttributes at line 65
attributesToArray()
No description
in
HasAttributes at line 111
HasAttributes
setAttribute(string $key, mixed $value)
Set a given attribute on the model.
in
HasAttributes at line 170
protected
asSerialized($value)
No description
in
HasAttributes at line 175
fromSerialized($value)
No description
in
HasAttributes at line 180
protected
isSerializedCastable($key)
No description
in
HasAttributes at line 185
protected
asDateTime($value)
No description
in
HasAttributes at line 197
protected
asTime($value)
No description
in
HasAttributes at line 242
string
fromTime(Carbon|int $value)
Convert a Carbon Time to a storable string.
in
HasAttributes at line 259
protected bool
isTimeCastable(string $key)
Determine whether a value is Time castable for inbound manipulation.
in
HasAttributes at line 268
protected string
getTimeFormat()
Get the format for database stored times.
in
HasAttributes at line 280
HasAttributes
setTimeFormat(string $format)
Set the time format used by the model.
in
HasRelationships at line 58
hasRelation($name)
No description
in
HasRelationships at line 70
array
getRelationDefinition(string $name)
Returns relationship details from a supplied name.
in
HasRelationships at line 81
array
getRelationDefinitions()
Returns relationship details for all relations defined on this model.
in
HasRelationships at line 108
string
getRelationType(string $name)
Returns a relationship type based on a supplied name.
in
HasRelationships at line 124
mixed
getRelationValue(string $key)
Get a relationship.
in
HasRelationships at line 141
protected $this
setRelationValue($relationName, $value)
Sets a relation value directly from its attribute.
in
HasRelationships at line 155
string
makeRelation(string $name)
Returns a relation class object
in
HasRelationships at line 177
bool
isRelationPushable(string $name)
Determines whether the specified relation should be saved when push() is called instead of save() on the model. Default: true.
in
HasRelationships at line 194
protected array
getRelationDefaults(string $type)
Returns default relation arguments for a given type.
in
HasRelationships at line 206
handleRelation($relationName)
No description
in
HasRelationships at line 334
protected array
validateRelationArgs($relationName, $optional, array $required = [])
Validate relation supplied arguments.
in
HasRelationships at line 374
HasOne
hasOne(string $related, string|null $foreignKey = null, string|null $localKey = null, null $relationName = null)
Define a one-to-one relationship.
in
HasRelationships at line 398
HasOneThrough
hasOneThrough($related, $through, $primaryKey = null, $throughKey = null, $localKey = null, $secondLocalKey = null, $relationName = null)
Define a has-one-through relationship.
This code is a duplicate of Eloquent but uses a Rain relation class.
in
HasRelationships at line 428
HasMany
hasMany(string $related, string|null $foreignKey = null, string|null $localKey = null, null $relationName = null)
Define a one-to-many relationship.
in
HasRelationships at line 459
HasManyThrough
hasManyThrough(string $related, string $through, string|null $firstKey = null, string|null $secondKey = null, string|null $localKey = null, string|null $secondLocalKey = null, null $relationName = null)
Define a has-many-through relationship.
in
HasRelationships at line 487
belongsTo($related, $foreignKey = null, $ownerKey = null, $relationName = null)
No description
in
HasRelationships at line 508
belongsToMany($related, $table = null, $foreignPivotKey = null, $relatedPivotKey = null, $parentKey = null, $relatedKey = null, $relationName = null)
No description
in
HasRelationships at line 541
MorphOne
morphOne(string $related, string $name, string|null $type = null, string|null $id = null, string|null $localKey = null, null $relationName = null)
Define a polymorphic one-to-one relationship.
in
HasRelationships at line 572
protected MorphTo
morphEagerTo(string $name, string $type, string $id, $ownerKey)
Define a polymorphic, inverse one-to-one or many relationship.
in
HasRelationships at line 594
protected MorphTo
morphInstanceTo(string $target, string $name, string $type, string $id, $ownerKey)
Define a polymorphic, inverse one-to-one or many relationship.
in
HasRelationships at line 621
MorphMany
morphMany(string $related, string $name, string|null $type = null, string|null $id = null, string|null $localKey = null, null $relationName = null)
Define a polymorphic one-to-many relationship.
in
HasRelationships at line 657
MorphToMany
morphToMany(string $related, string $name, string|null $table = null, string|null $foreignPivotKey = null, string|null $relatedPivotKey = null, string|null $parentKey = null, string|null $relatedKey = null, bool $inverse = false, null $relationName = null)
Define a polymorphic many-to-many relationship.
in
HasRelationships at line 705
MorphToMany
morphedByMany(string $related, string $name, string|null $table = null, string|null $foreignPivotKey = null, string|null $relatedPivotKey = null, string|null $parentKey = null, string|null $relatedKey = null, null $relationName = null)
Define a polymorphic, inverse many-to-many relationship.
in
Model at line 88
__construct(array $attributes = [])
No description
in
Model at line 103
static Model|Model
make(array $attributes = [])
Create a new model and return the instance.
in
Model at line 117
static Model|Model
create(array $attributes = [], string $sessionKey = null)
Save a new model and return the instance.
in
Model at line 148
void
reloadRelations(string $relationName = null)
Reloads the model relationship cache.
in
Model at line 163
static
extend(Closure $callback)
Extend this object properties upon construction.
in
Model at line 171
protected
bootNicerEvents()
Bind some nicer events to this model, in the format of method overrides.
in
Model at line 214
static void
flushEventListeners()
Remove all of the event listeners for the model Also flush registry of models that had events booted Allows painless unit testing.
in
Model at line 229
Model|Model
newFromBuilder(array $attributes = [], null $connection = null)
Create a new model instance that is existing.
in
Model at line 248
protected
beforeCreate()
Handle the "creating" model event
in
Model at line 255
protected
afterCreate()
Handle the "created" model event
in
Model at line 262
protected
beforeUpdate()
Handle the "updating" model event
in
Model at line 269
protected
afterUpdate()
Handle the "updated" model event
in
Model at line 276
protected
beforeSave()
Handle the "saving" model event
in
Model at line 283
protected
afterSave()
Handle the "saved" model event
in
Model at line 290
protected
beforeDelete()
Handle the "deleting" model event
in
Model at line 297
protected
afterDelete()
Handle the "deleted" model event
in
Model at line 304
protected
beforeFetch()
Handle the "fetching" model event
in
Model at line 311
protected
afterFetch()
Handle the "fetched" model event
in
Model at line 322
static void
fetching(Closure|string $callback)
Create a new native event for handling beforeFetch().
in
Model at line 334
static void
fetched(Closure|string $callback)
Create a new native event for handling afterFetch().
in
Model at line 339
setUpdatedAt($value)
No description
in
Model at line 347
setCreatedAt($value)
No description
in
Model at line 363
array
getObservableEvents()
Get the observable event names.
in
Model at line 375
protected
isRelationPurgeable($name)
No description
in
Model at line 391
Builder
newEloquentBuilder(Builder $query)
Create a new Eloquent query builder for the model.
in
Model at line 400
string
getForeignKey()
Get the default foreign key name for the model.
in
Model at line 409
__get($key)
No description
in
Model at line 414
__set($name, $value)
No description
in
Model at line 427
mixed
__call(string $method, $params)
Handle dynamic method calls into the model.
in
Model at line 448
Pivot
newPivot(Model $parent, array $attributes, string $table, bool $exists, string|null $using = null)
Create a generic pivot model instance.
in
Model at line 464
Pivot
newRelationPivot(string $relationName, Model $parent, array $attributes, string $table, bool $exists)
Create a pivot model instance specific to a relation.
in
Model at line 487
protected bool
saveInternal(array $options = [])
Save the model to the database. Is used by save()
in
Model at line 521
bool
save(array $options = null, null $sessionKey = null)
Save the model to the database.
in
Model at line 535
bool
push(array $options = null, null $sessionKey = null)
Save the model and all of its relationships.
in
Model at line 577
bool
alwaysPush(array $options = null, string $sessionKey = null)
Pushes the first level of relations even if the parent model has no changes.
in
Model at line 586
protected void
performDeleteOnModel()
Perform the actual delete query on this model instance.
in
Model at line 596
protected void
performDeleteOnRelations()
Locates relations with delete flag and cascades the delete event.