Group

Group model

 class Winter\Storm\Auth\Models\Group
extends Winter\Storm\Database\Model
implements 
    Winter\Storm\Database\ModelInterface

Extends

Class Description
Model

Active Record base class.

Traits

Trait Description
DeferredBinding
Emitter

Adds event related features to any class.

ExtendableTrait

This extension trait is used when access to the underlying base class is not available, such as classes that belong to the foundation framework (Laravel). It is currently used by the Controller and Model classes.

GuardsAttributes
HasRelationships
HidesAttributes

Hides and shows attributes for serialization.

Purgeable
Validation

Properties

public $belongsToMany : array

Relations

public $rules : array

Validation rules

protected $guarded : string[] | bool

The attributes that aren't mass assignable.

protected $table : string

The table associated with the model.

inherited public $attachMany : mixed

Inherited from HasRelationships

protected $attachMany = [ 'pictures' => ['Winter\Storm\Database\Attach\File', 'name'=> 'imageable'] ];

inherited public $attachOne : mixed

Inherited from HasRelationships

protected $attachOne = [ 'picture' => ['Winter\Storm\Database\Attach\File', 'public' => false] ];

inherited public $attributes : array

Inherited from Model

Make the model's attributes public so behaviors can modify them.

inherited public $belongsTo : mixed

Inherited from HasRelationships

protected $belongsTo = [ 'parent' => ['Category', 'key' => 'parent_id'] ];

inherited public $duplicateCache : bool

Inherited from Model

Indicates if duplicate queries from this model should be cached in memory.

inherited public $hasMany : array

Inherited from HasRelationships

Cleaner declaration of relationships.

Uses a similar approach to the relation methods used by Eloquent, but as separate properties that make the class file less cluttered.

It should be declared with keys as the relation name, and value being a mixed array. The relation type $morphTo does not include a classname as the first value.

Example: class Order extends Model { protected $hasMany = [ 'items' => 'Item' ]; }

inherited public $hasManyThrough : mixed

Inherited from HasRelationships

protected $hasManyThrough = [ 'posts' => ['Posts', 'through' => 'User'] ];

inherited public $hasOne : mixed

Inherited from HasRelationships

protected $hasOne = [ 'owner' => ['User', 'key' => 'user_id'] ];

inherited public $hasOneThrough : mixed

Inherited from HasRelationships

protected $hasOneThrough = [ 'post' => ['Posts', 'through' => 'User'] ];

inherited public $implement : string | array | null

Inherited from Model

Extensions implemented by this class.

inherited public $morphMany : mixed

Inherited from HasRelationships

protected $morphMany = [ 'log' => ['History', 'name' => 'user'] ];

inherited public $morphOne : mixed

Inherited from HasRelationships

protected $morphOne = [ 'log' => ['History', 'name' => 'user'] ];

inherited public $morphTo : mixed

Inherited from HasRelationships

protected $morphTo = [ 'pictures' => [] ];

inherited public $morphToMany : mixed

Inherited from HasRelationships

protected $morphToMany = [ 'tag' => ['Tag', 'table' => 'tagables', 'name' => 'tagable'] ];

inherited public $morphedByMany : mixed

Inherited from HasRelationships

inherited public $sessionKey : string

Inherited from DeferredBinding

A unique session key used for deferred binding.

inherited public $trimStringAttributes : bool

Inherited from Model

Indicates if all string model attributes will be trimmed prior to saving.

inherited protected $dates : array

Inherited from Model

List of datetime attributes to convert to an instance of Carbon/DateTime objects.

inherited protected $emitterEventCollection : array

Inherited from Emitter

Collection of registered events.

inherited protected $emitterEventSorted : array

Inherited from Emitter

Sorted collection of events.

inherited protected $emitterSingleEventCollection : array

Inherited from Emitter

Collection of registered events to be fired once only.

inherited protected static $eventsBooted : array

Inherited from Model

The array of models booted events.

inherited protected static $extendableCallbacks : array

Inherited from ExtendableTrait

Used to extend the constructor of an extendable class. Eg:

Class::extend(function($obj) { })

inherited protected static $extendableClassLoader : ClassLoader | null

Inherited from ExtendableTrait

Class loader instance.

inherited protected static $extendableStaticMethods : array

Inherited from ExtendableTrait

Collection of static methods used by behaviors.

inherited protected $extensionData : array

Inherited from ExtendableTrait

Class reflection information, including behaviors.

inherited protected $jsonable : array

Inherited from Model

List of attribute names which are json encoded and decoded from the database.

inherited protected $originalPurgeableValues : array

Inherited from Purgeable

List of original attribute values before they were purged.

inherited protected $purgeable : array

Inherited from Model

List of attributes which should not be saved to the database.

inherited protected static $relationTypes : array

Inherited from HasRelationships

Excepted relationship types, used to cycle and verify relationships.

inherited protected $validationDefaultAttrNames : array

Inherited from Validation

Default custom attribute names.

inherited protected $validationErrors : Illuminate\Support\MessageBag

Inherited from Validation

The message bag instance containing validation error messages

Methods

public delete () : bool

Delete the group.

Returns
bool

inherited public __call ($name, $params)

Inherited from Model
Parameters
Property Description
$name
mixed
$params
mixed
Returns
mixed

inherited public static __callStatic ($name, $params)

Inherited from Model
Parameters
Property Description
$name
mixed
$params
mixed
Returns
mixed

inherited public __construct (array $attributes = [])

Inherited from Model

Constructor

Parameters
Property Description
$attributes
array
Returns
mixed

inherited public __get ($name)

Inherited from Model
Parameters
Property Description
$name
mixed
Returns
mixed

inherited public __isset (string $key) : bool

Inherited from Model

Determine if an attribute or relation exists on the model.

Parameters
Property Description
$key
string
Returns
bool

inherited public __set ($name, $value)

Inherited from Model
Parameters
Property Description
$name
mixed
$value
mixed
Returns
mixed

inherited public addAttachManyRelation (string $name, array $config) : void

Inherited from HasRelationships

Dynamically add an AttachMany relationship

Parameters
Property Description
$name
string
$config
array
Returns
void

inherited public addAttachOneRelation (string $name, array $config) : void

Inherited from HasRelationships

Dynamically add an AttachOne relationship

Parameters
Property Description
$name
string
$config
array
Returns
void

inherited public addBelongsToManyRelation (string $name, array $config) : void

Inherited from HasRelationships

Dynamically add a BelongsToMany relationship

Parameters
Property Description
$name
string
$config
array
Returns
void

inherited public addBelongsToRelation (string $name, array $config) : void

Inherited from HasRelationships

Dynamically add a BelongsTo relationship

Parameters
Property Description
$name
string
$config
array
Returns
void

inherited public addCasts (array $attributes) : void

Inherited from Model

Add attribute casts for the model.

Parameters
Property Description
$attributes
array
Returns
void

inherited public addDateAttribute (string $attribute) : void

Inherited from Model

Adds a datetime attribute to convert to an instance of Carbon/DateTime object.

Parameters
Property Description
$attribute
string
Returns
void

inherited public addDynamicMethod (string $dynamicName, callable $method, string $extension = null)

Inherited from ExtendableTrait

Programmatically adds a method to the extendable class

Parameters
Property Description
$dynamicName
string
$method
callable
$extension
string
Returns
mixed

inherited public addDynamicProperty (string $dynamicName, mixed $value = null) : void

Inherited from Model

Programmatically adds a property to the extendable class

Parameters
Property Description
$dynamicName
string

The name of the property to add

$value
mixed

The value of the property

Returns
void

inherited public addFillable (array | string | null $attributes = null) : void

Inherited from Model

Add fillable attributes for the model.

Parameters
Property Description
$attributes
array | string | null
Returns
void

inherited public addHasManyRelation (string $name, array $config) : void

Inherited from HasRelationships

Dynamically add a HasMany relationship

Parameters
Property Description
$name
string
$config
array
Returns
void

inherited public addHasManyThroughRelation (string $name, array $config) : void

Inherited from HasRelationships

Dynamically add a(n) HasManyThrough relationship

Parameters
Property Description
$name
string
$config
array
Returns
void

inherited public addHasOneRelation (string $name, array $config) : void

Inherited from HasRelationships

Dynamically add a HasOne relationship

Parameters
Property Description
$name
string
$config
array
Returns
void

inherited public addHasOneThroughRelation (string $name, array $config) : void

Inherited from HasRelationships

Dynamically add a(n) HasOneThrough relationship

Parameters
Property Description
$name
string
$config
array
Returns
void

inherited public addHidden (array | string | null $attributes = null) : void

Inherited from HidesAttributes

Add hidden attributes for the model.

This restores the addHidden method that was removed from Laravel 7 onwards. It is however recommended to use the makeHidden method going forward.

Parameters
Property Description
$attributes
array | string | null
Returns
void

inherited public addJsonable (array | string | null $attributes = null) : void

Inherited from Model

Add jsonable attributes for the model.

Parameters
Property Description
$attributes
array | string | null
Returns
void

inherited public addMorphManyRelation (string $name, array $config) : void

Inherited from HasRelationships

Dynamically add a MorphMany relationship

Parameters
Property Description
$name
string
$config
array
Returns
void

inherited public addMorphOneRelation (string $name, array $config) : void

Inherited from HasRelationships

Dynamically add a MorphOne relationship

Parameters
Property Description
$name
string
$config
array
Returns
void

inherited public addMorphToManyRelation (string $name, array $config) : void

Inherited from HasRelationships

Dynamically add a MorphToMany relationship

Parameters
Property Description
$name
string
$config
array
Returns
void

inherited public addMorphToRelation (string $name, array $config) : void

Inherited from HasRelationships

Dynamically add a MorphTo relationship

Parameters
Property Description
$name
string
$config
array
Returns
void

inherited public addMorphedByManyRelation (string $name, array $config) : void

Inherited from HasRelationships

Dynamically add a MorphedByMany relationship

Parameters
Property Description
$name
string
$config
array
Returns
void

inherited public addPurgeable (array | string | null $attributes = null) : $this

Inherited from Purgeable

Adds an attribute to the purgeable attributes list

Parameters
Property Description
$attributes
array | string | null
Returns
$this

inherited public addVisible (array | string | null $attributes = null) : void

Inherited from HidesAttributes

Add visible attributes for the model.

This restores the addVisible method that was removed from Laravel 7 onwards. It is however recommended to use the makeVisible method going forward.

Parameters
Property Description
$attributes
array | string | null
Returns
void

inherited public alwaysPush (array $options = [], string | null $sessionKey = null) : bool

Inherited from Model

Pushes the first level of relations even if the parent model has no changes.

Parameters
Property Description
$options
array
$sessionKey
string | null
Returns
bool

inherited public asExtension (string $shortName) : mixed

Inherited from ExtendableTrait

Short hand for getClassExtension() method, except takes the short extension name, example:

$this->asExtension('FormController')

Parameters
Property Description
$shortName
string
Returns
mixed

inherited public attachMany ($related, $isPublic = null, $localKey = null, $relationName = null) : Winter\Storm\Database\Relations\AttachMany

Inherited from HasRelationships

Define an attachment one-to-many relationship.

This code is a duplicate of Eloquent but uses a Storm relation class.

Parameters
Property Description
$related
mixed
$isPublic
mixed
$localKey
mixed
$relationName
mixed
Returns

inherited public attachOne ($related, boolean $isPublic = true, $localKey = null, $relationName = null) : Winter\Storm\Database\Relations\AttachOne

Inherited from HasRelationships

Define an attachment one-to-one relationship.

This code is a duplicate of Eloquent but uses a Storm relation class.

Parameters
Property Description
$related
mixed
$isPublic
boolean
$localKey
mixed
$relationName
mixed
Returns

inherited public attributesToArray () : array

Inherited from Model

Convert the model's attributes to an array.

Returns
array

inherited public belongsTo ($related, $foreignKey = null, $parentKey = null, $relationName = null) : Winter\Storm\Database\Relations\BelongsTo

Inherited from HasRelationships

Define an inverse one-to-one or many relationship.

Overridden from {@link Eloquent\Model} to allow the usage of the intermediary methods to handle the {@link $relationsData} array.

Parameters
Property Description
$related
mixed
$foreignKey
mixed
$parentKey
mixed
$relationName
mixed
Returns

inherited public belongsToMany ($related, $table = null, $primaryKey = null, $foreignKey = null, $parentKey = null, $relatedKey = null, $relationName = null) : Winter\Storm\Database\Relations\BelongsToMany

Inherited from HasRelationships

Define a many-to-many relationship.

This code is almost a duplicate of Eloquent but uses a Storm relation class.

Parameters
Property Description
$related
mixed
$table
mixed
$primaryKey
mixed
$foreignKey
mixed
$parentKey
mixed
$relatedKey
mixed
$relationName
mixed
Returns

inherited public bindDeferred (string $relation, Illuminate\Database\Eloquent\Model $record, string $sessionKey, array $pivotData = []) : Winter\Storm\Database\Models\DeferredBinding

Inherited from DeferredBinding

Bind a deferred relationship to the supplied record.

Parameters
Property Description
$relation
string
$record
Illuminate\Database\Eloquent\Model
$sessionKey
string
$pivotData
array
Returns
Winter\Storm\Database\Models\DeferredBinding

inherited public bindEvent (string | Closure | QueuedClosure $event, mixed $callback = null, integer $priority) : self

Inherited from Emitter

Create a new event binding.

Parameters
Property Description
$event
string | Closure | QueuedClosure
$callback
mixed

when the third parameter is omitted and a Closure or QueuedClosure is provided this parameter is used as an integer this is used as priority variable

$priority
integer
Returns
self

inherited public bindEventOnce (string | Closure | QueuedClosure $event, QueuedClosure | Closure | null $callback = null) : self

Inherited from Emitter

Create a new event binding that fires once only

Parameters
Property Description
$event
string | Closure | QueuedClosure
$callback
QueuedClosure | Closure | null

When a Closure or QueuedClosure is provided as the first parameter this parameter can be omitted

Returns
self

inherited public static bootPurgeable () : void

Inherited from Purgeable

Boot the purgeable trait for a model.

Returns
void

inherited public static bootValidation () : void

Inherited from Validation

Boot the validation trait for this model.

Returns
void

inherited public cancelDeferred (string $sessionKey) : void

Inherited from DeferredBinding

Cancel all deferred bindings to this model.

Parameters
Property Description
$sessionKey
string
Returns
void

inherited public static clearExtendedClasses () : void

Inherited from ExtendableTrait

Clear the list of extended classes so they will be re-extended.

Returns
void

inherited public commitDeferred (string $sessionKey) : void

Inherited from DeferredBinding

Commit all deferred bindings to this model.

Parameters
Property Description
$sessionKey
string
Returns
void

inherited public static create (array $attributes = [], string $sessionKey = null) : Illuminate\Database\Eloquent\Model | static

Inherited from Model

Save a new model and return the instance.

Parameters
Property Description
$attributes
array
$sessionKey
string
Returns
Illuminate\Database\Eloquent\Model | static

inherited public errors () : Illuminate\Support\MessageBag

Inherited from Validation

Get validation error message collection for the Model

Returns
Illuminate\Support\MessageBag

inherited public extendClassWith (string $extensionName) : void

Inherited from ExtendableTrait

Dynamically extend a class with a specified behavior

Parameters
Property Description
$extensionName
string
Returns
void

inherited public extendableCall (string $name, array $params = null) : mixed

Inherited from ExtendableTrait

Magic method for __call().

Callback priority is as follows:

  • "Dynamic Methods" added locally to the object via addDynamicMethod($name, $callable)
  • Methods available on Behaviors that have been implemented by the object
  • Pass it to the parent's __call() method if it defines one
Parameters
Property Description
$name
string
$params
array
Returns
mixed

inherited public static extendableCallStatic (string $name, array $params = null) : mixed

Inherited from ExtendableTrait

Magic method for __callStatic()

Parameters
Property Description
$name
string
$params
array
Returns
mixed

inherited public extendableConstruct ()

Inherited from ExtendableTrait

This method should be called as part of the constructor.

Returns
mixed

inherited public static extendableExtendCallback (callable $callback, boolean $scoped = false, $outerScope = null) : void

Inherited from ExtendableTrait

Helper method for ::extend() static method.

Parameters
Property Description
$callback
callable
$scoped
boolean
$outerScope
mixed
Returns
void

inherited public extendableGet (string $name) : mixed | null

Inherited from ExtendableTrait

Magic method for __get()

Parameters
Property Description
$name
string
Returns
mixed | null

inherited public extendableSet (string $name, mixed $value) : void

Inherited from ExtendableTrait

Magic method for __set()

Parameters
Property Description
$name
string
$value
mixed
Returns
void

inherited public static fetched (Closure | string $callback) : void

Inherited from Model

Create a new native event for handling afterFetch().

Parameters
Property Description
$callback
Closure | string
Returns
void

inherited public static fetching (Closure | string $callback) : void

Inherited from Model

Create a new native event for handling beforeFetch().

Parameters
Property Description
$callback
Closure | string
Returns
void

inherited public fireEvent (string $event, array $params = [], boolean $halt = false) : array | mixed | null

Inherited from Emitter

Fire an event and call the listeners.

Parameters
Property Description
$event
string

Event name

$params
array

Event parameters

$halt
boolean

Halt after first non-null result

Returns
array | mixed | null

If halted, the first non-null result. If not halted, an array of event results. Returns null if no listeners returned a result.

inherited public static flushDuplicateCache () : void

Inherited from Model

Flush the memory cache.

Returns
void

inherited public static flushEventListeners () : void

Inherited from Model

Remove all of the event listeners for the model Also flush registry of models that had events booted Allows painless unit testing.

Returns
void

inherited public forceSave ($options = null, $sessionKey = null) : bool

Inherited from Validation

Force save the model even if validation fails.

Parameters
Property Description
$options
mixed
$sessionKey
mixed
Returns
bool

inherited public freshTimestamp () : Illuminate\Support\Carbon

Inherited from Model

Get a fresh timestamp for the model.

Returns
Illuminate\Support\Carbon

inherited public fromDateTime (DateTime | int | null $value = null) : string | null

Inherited from Model

Convert a DateTime to a storable string.

Parameters
Property Description
$value
DateTime | int | null
Returns
string | null

inherited public getAttribute (string $key) : mixed

Inherited from Model

Get an attribute from the model.

Overrides {@link Eloquent} to support loading from property-defined relations.

Parameters
Property Description
$key
string
Returns
mixed

inherited public getAttributeValue (string $key) : mixed

Inherited from Model

Get a plain attribute (not a relationship).

Parameters
Property Description
$key
string
Returns
mixed

inherited public getClassExtension (string $name) : mixed

Inherited from ExtendableTrait

Returns a behavior object from an extendable class, example:

$this->getClassExtension('Backend.Behaviors.FormController')

Parameters
Property Description
$name
string

Fully qualified behavior name

Returns
mixed

inherited public getClassMethods () : array

Inherited from ExtendableTrait

Get a list of class methods, extension equivalent of get_class_methods()

Returns
array

inherited public getDynamicProperties () : array

Inherited from ExtendableTrait

Returns all dynamic properties and their values

Returns
array

['property' => 'value']

inherited public getJsonable () : array

Inherited from Model

Get the jsonable attributes name

Returns
array

inherited public getObservableEvents () : array

Inherited from Model

Get the observable event names.

Returns
array

inherited public getOriginalPurgeValue ($attribute)

Inherited from Purgeable

Returns the original values of any purged attributes.

Parameters
Property Description
$attribute
mixed
Returns
mixed

inherited public getOriginalPurgeValues ()

Inherited from Purgeable

Returns the original values of any purged attributes.

Returns
mixed

inherited public getPurgeableAttributes ()

Inherited from Purgeable

Returns a collection of fields that will be hashed.

Returns
mixed

inherited public getRelationDefinition (string $name) : array | null

Inherited from HasRelationships

Returns relationship details from a supplied name.

Parameters
Property Description
$name
string

Relation name

Returns
array | null

inherited public getRelationDefinitions () : array

Inherited from HasRelationships

Returns relationship details for all relations defined on this model.

Returns
array

inherited public getRelationType (string $name) : string | null

Inherited from HasRelationships

Returns a relationship type based on a supplied name.

Parameters
Property Description
$name
string
Returns
string | null

inherited public getRelationTypeDefinition (string $type, string $name) : string | null

Inherited from HasRelationships

Returns the given relation definition.

Parameters
Property Description
$type
string

Relation type

$name
string

Relation name

Returns
string | null

inherited public getRelationTypeDefinitions (string $type) : array | string | null

Inherited from HasRelationships

Returns all defined relations of given type.

Parameters
Property Description
$type
string

Relation type

Returns
array | string | null

inherited public getRelationValue ($relationName)

Inherited from HasRelationships

Returns a relation key value(s), not as an object.

Parameters
Property Description
$relationName
mixed
Returns
mixed

inherited public hasAttribute (string $key) : bool

Inherited from Model

Determine if the given attribute will be processed by getAttributeValue().

Parameters
Property Description
$key
string
Returns
bool

inherited public static hasDatabaseTable () : bool

Inherited from Model

Static helper for isDatabaseReady()

Returns
bool

inherited public hasGetMutator (string $key) : bool

Inherited from Model

Determine if a get mutator exists for an attribute.

Parameters
Property Description
$key
string
Returns
bool

inherited public hasMany ($related, $primaryKey = null, $localKey = null, $relationName = null) : Winter\Storm\Database\Relations\HasMany

Inherited from HasRelationships

Define a one-to-many relationship.

This code is a duplicate of Eloquent but uses a Storm relation class.

Parameters
Property Description
$related
mixed
$primaryKey
mixed
$localKey
mixed
$relationName
mixed
Returns

inherited public hasManyThrough ($related, $through, $primaryKey = null, $throughKey = null, $localKey = null, $secondLocalKey = null, $relationName = null) : Winter\Storm\Database\Relations\HasManyThrough

Inherited from HasRelationships

Define a has-many-through relationship.

This code is a duplicate of Eloquent but uses a Storm relation class.

Parameters
Property Description
$related
mixed
$through
mixed
$primaryKey
mixed
$throughKey
mixed
$localKey
mixed
$secondLocalKey
mixed
$relationName
mixed
Returns

inherited public hasOne ($related, $primaryKey = null, $localKey = null, $relationName = null) : Winter\Storm\Database\Relations\HasOne

Inherited from HasRelationships

Define a one-to-one relationship.

This code is a duplicate of Eloquent but uses a Storm relation class.

Parameters
Property Description
$related
mixed
$primaryKey
mixed
$localKey
mixed
$relationName
mixed
Returns

inherited public hasOneThrough ($related, $through, $primaryKey = null, $throughKey = null, $localKey = null, $secondLocalKey = null, $relationName = null) : Winter\Storm\Database\Relations\HasOneThrough

Inherited from HasRelationships

Define a has-one-through relationship.

This code is a duplicate of Eloquent but uses a Storm relation class.

Parameters
Property Description
$related
mixed
$through
mixed
$primaryKey
mixed
$throughKey
mixed
$localKey
mixed
$secondLocalKey
mixed
$relationName
mixed
Returns

inherited public hasRelation (string $name) : bool

Inherited from HasRelationships

Checks if model has a relationship by supplied name.

Parameters
Property Description
$name
string

Relation name

Returns
bool

inherited public hasSetMutator (string $key) : bool

Inherited from Model

Determine if a set mutator exists for an attribute.

Parameters
Property Description
$key
string
Returns
bool

inherited public isAttributeRequired (string $attribute, boolean $checkDependencies = true) : bool

Inherited from Validation

Determines if an attribute is required based on the validation rules.

Parameters
Property Description
$attribute
string
$checkDependencies
boolean

Checks the attribute dependencies (for required_if & required_with rules). Note that it will only be checked up to the next level, if another dependent rule is found then it will just assume the field is required

Returns
bool

inherited public isClassExtendedWith (string $name) : bool

Inherited from ExtendableTrait

Check if extendable class is extended with a behavior object

Parameters
Property Description
$name
string

Fully qualified behavior name

Returns
bool

inherited public isDatabaseReady () : bool

Inherited from Model

Check if the model's database connection is ready

Returns
bool

inherited public isDeferrable (string $relationName) : bool

Inherited from DeferredBinding

Returns true if a relation exists and can be deferred.

Parameters
Property Description
$relationName
string
Returns
bool

inherited public isGuarded (string $key) : bool

Inherited from GuardsAttributes

Determine if the given key is guarded.

This is an override of https://github.com/laravel/framework/commit/897d107775737a958dbd0b2f3ea37877c7526371 and allows fields that don't exist in the database to be filled if they aren't specified as "guarded", under the pretense that they are handled in a special manner - ie. in the beforeSave event.

Parameters
Property Description
$key
string
Returns
bool

inherited public isJsonable ($key) : bool

Inherited from Model

Checks if an attribute is jsonable or not.

Parameters
Property Description
$key
mixed
Returns
bool

inherited public isRelationPushable (string $name) : bool

Inherited from HasRelationships

Determines whether the specified relation should be saved when push() is called instead of save() on the model. Default: true.

Parameters
Property Description
$name
string

Relation name

Returns
bool

inherited public jsonable (array $jsonable) : $this

Inherited from Model

Set the jsonable attributes for the model.

Parameters
Property Description
$jsonable
array
Returns
$this

inherited public static make (array $attributes = []) : Illuminate\Database\Eloquent\Model | static

Inherited from Model

Create a new model and return the instance.

Parameters
Property Description
$attributes
array
Returns
Illuminate\Database\Eloquent\Model | static

inherited public makeRelation (string $name) : Winter\Storm\Database\Model | null

Inherited from HasRelationships

Returns a new instance of a related model

Parameters
Property Description
$name
string
Returns
Winter\Storm\Database\Model | null

inherited public methodExists (string $name) : bool

Inherited from ExtendableTrait

Checks if a method exists, extension equivalent of method_exists()

Parameters
Property Description
$name
string
Returns
bool

inherited public morphMany ($related, $name, $type = null, $id = null, $localKey = null, $relationName = null) : Winter\Storm\Database\Relations\MorphMany

Inherited from HasRelationships

Define a polymorphic one-to-many relationship.

This code is a duplicate of Eloquent but uses a Storm relation class.

Parameters
Property Description
$related
mixed
$name
mixed
$type
mixed
$id
mixed
$localKey
mixed
$relationName
mixed
Returns

inherited public morphOne ($related, $name, $type = null, $id = null, $localKey = null, $relationName = null) : Winter\Storm\Database\Relations\MorphOne

Inherited from HasRelationships

Define a polymorphic one-to-one relationship.

This code is a duplicate of Eloquent but uses a Storm relation class.

Parameters
Property Description
$related
mixed
$name
mixed
$type
mixed
$id
mixed
$localKey
mixed
$relationName
mixed
Returns

inherited public morphTo ($name = null, $type = null, $id = null, $ownerKey = null) : Winter\Storm\Database\Relations\MorphTo

Inherited from HasRelationships

Define an polymorphic, inverse one-to-one or many relationship.

Overridden from {@link Eloquent\Model} to allow the usage of the intermediary methods to handle the relation.

Parameters
Property Description
$name
mixed
$type
mixed
$id
mixed
$ownerKey
mixed
Returns

inherited public morphToMany ($related, $name, $table = null, $primaryKey = null, $foreignKey = null, $parentKey = null, $relatedKey = null, boolean $inverse = false, $relationName = null) : Winter\Storm\Database\Relations\MorphToMany

Inherited from HasRelationships

Define a polymorphic many-to-many relationship.

This code is almost a duplicate of Eloquent but uses a Storm relation class.

Parameters
Property Description
$related
mixed
$name
mixed
$table
mixed
$primaryKey
mixed
$foreignKey
mixed
$parentKey
mixed
$relatedKey
mixed
$inverse
boolean
$relationName
mixed
Returns

inherited public morphedByMany ($related, $name, $table = null, $primaryKey = null, $foreignKey = null, $parentKey = null, $relatedKey = null, $relationName = null) : Winter\Storm\Database\Relations\MorphToMany

Inherited from HasRelationships

Define a polymorphic many-to-many inverse relationship.

This code is almost a duplicate of Eloquent but uses a Storm relation class.

Parameters
Property Description
$related
mixed
$name
mixed
$table
mixed
$primaryKey
mixed
$foreignKey
mixed
$parentKey
mixed
$relatedKey
mixed
$relationName
mixed
Returns

inherited public newCollection (array $models = []) : Winter\Storm\Database\Collection

Inherited from Model

Create a new Model Collection instance.

Parameters
Property Description
$models
array
Returns

inherited public newEloquentBuilder (Winter\Storm\Database\QueryBuilder $query) : Winter\Storm\Database\Builder

Inherited from Model

Create a new Eloquent query builder for the model.

Parameters
Returns

inherited public newFromBuilder (array $attributes = [], $connection = null) : Illuminate\Database\Eloquent\Model | static

Inherited from Model

Create a new model instance that is existing.

Parameters
Property Description
$attributes
array
$connection
mixed
Returns
Illuminate\Database\Eloquent\Model | static

inherited public newPivot (Illuminate\Database\Eloquent\Model $parent, array $attributes, string $table, bool $exists, string | null $using = null) : Winter\Storm\Database\Pivot

Inherited from Model

Create a generic pivot model instance.

Parameters
Property Description
$parent
Illuminate\Database\Eloquent\Model
$attributes
array
$table
string
$exists
bool
$using
string | null
Returns

inherited public newRelationPivot (string $relationName, Winter\Storm\Database\Model $parent, array $attributes, string $table, bool $exists) : Winter\Storm\Database\Pivot | null

Inherited from Model

Create a pivot model instance specific to a relation.

Parameters
Property Description
$relationName
string
$parent
$attributes
array
$table
string
$exists
bool
Returns

inherited public offsetExists (mixed $offset) : bool

Inherited from Model

This a custom piece of logic specifically to satisfy Twig's desire to return a relation object instead of loading the related model.

Parameters
Property Description
$offset
mixed
Returns
bool

inherited public propertyExists (string $name) : bool

Inherited from ExtendableTrait

Checks if a property exists, extension equivalent of property_exists()

Parameters
Property Description
$name
string
Returns
bool

inherited public purgeAttributes (array | string $attributesToPurge = null) : array

Inherited from Purgeable

Removes purged attributes from the dataset, used before saving.

Parameters
Property Description
$attributesToPurge
array | string

Attribute(s) to purge, if unspecified, $purgable property is used

Returns
array

Current attribute set

inherited public push (array $options = [], string | null $sessionKey = null) : bool

Inherited from Model

Save the model and all of its relationships.

Parameters
Property Description
$options
array
$sessionKey
string | null
Returns
bool

inherited public reload () : Illuminate\Database\Eloquent\Model | static

Inherited from Model

Reloads the model attributes from the database.

Returns
Illuminate\Database\Eloquent\Model | static

inherited public reloadRelations (string $relationName = null) : void

Inherited from Model

Reloads the model relationship cache.

Parameters
Property Description
$relationName
string
Returns
void

inherited public restorePurgedValues ()

Inherited from Purgeable

Restores the original values of any purged attributes.

Returns
mixed

inherited public save (array $options = [], string | null $sessionKey = null) : bool

Inherited from Model

Save the model to the database.

Parameters
Property Description
$options
array
$sessionKey
string | null
Returns
bool

inherited public setAttribute (string $key, mixed $value) : mixed | null

Inherited from Model

Set a given attribute on the model.

Parameters
Property Description
$key
string
$value
mixed
Returns
mixed | null

inherited public setValidationAttributeName (string $attr, string $name) : void

Inherited from Validation

Programatically sets the validation attribute names, will take lower priority to model defined attribute names found in $attributeNames.

Parameters
Property Description
$attr
string
$name
string
Returns
void

inherited public setValidationAttributeNames (array $attributeNames) : void

Inherited from Validation

Programatically sets multiple validation attribute names.

Parameters
Property Description
$attributeNames
array
Returns
void

inherited public unbindDeferred (string $relation, Illuminate\Database\Eloquent\Model $record, string $sessionKey) : Winter\Storm\Database\Models\DeferredBinding

Inherited from DeferredBinding

Unbind a deferred relationship to the supplied record.

Parameters
Property Description
$relation
string
$record
Illuminate\Database\Eloquent\Model
$sessionKey
string
Returns
Winter\Storm\Database\Models\DeferredBinding

inherited public unbindEvent (string | array | object $event = null) : self

Inherited from Emitter

Destroys an event binding.

Parameters
Property Description
$event
string | array | object

Event to destroy

Returns
self

inherited public validate ($rules = null, $customMessages = null, $attributeNames = null) : bool

Inherited from Validation

Validate the model instance

Parameters
Property Description
$rules
mixed
$customMessages
mixed
$attributeNames
mixed
Returns
bool

inherited public static validated (Closure | string $callback) : void

Inherited from Validation

Create a new native event for handling afterValidate().

Parameters
Property Description
$callback
Closure | string
Returns
void

inherited public static validating (Closure | string $callback) : void

Inherited from Validation

Create a new native event for handling beforeValidate().

Parameters
Property Description
$callback
Closure | string
Returns
void

inherited protected addRelation (string $type, string $name, array $config) : void

Inherited from HasRelationships

Dynamically add the provided relationship configuration to the local properties

Parameters
Property Description
$type
string
$name
string
$config
array
Returns
void

inherited protected afterCreate ()

Inherited from Model

Handle the "created" model event

Returns
mixed

inherited protected afterDelete ()

Inherited from Model

Handle the "deleted" model event

Returns
mixed

inherited protected afterFetch ()

Inherited from Model

Handle the "fetched" model event

Returns
mixed

inherited protected afterSave ()

Inherited from Model

Handle the "saved" model event

Returns
mixed

inherited protected afterUpdate ()

Inherited from Model

Handle the "updated" model event

Returns
mixed

inherited protected asDateTime (mixed $value) : Carbon\Carbon

Inherited from Model

Return a timestamp as DateTime object.

Parameters
Property Description
$value
mixed
Returns
Carbon\Carbon

inherited protected beforeCreate ()

Inherited from Model

Handle the "creating" model event

Returns
mixed

inherited protected beforeDelete ()

Inherited from Model

Handle the "deleting" model event

Returns
mixed

inherited protected beforeFetch ()

Inherited from Model

Handle the "fetching" model event

Returns
mixed

inherited protected beforeSave ()

Inherited from Model

Handle the "saving" model event

Returns
mixed

inherited protected beforeUpdate ()

Inherited from Model

Handle the "updating" model event

Returns
mixed

inherited protected bootNicerEvents ()

Inherited from Model

Bind some nicer events to this model, in the format of method overrides.

Returns
mixed

inherited protected commitDeferredAfter (string $sessionKey) : void

Inherited from DeferredBinding

Internally used method to commit all deferred bindings after saving.

Parameters
Property Description
$sessionKey
string
Returns
void

inherited protected commitDeferredBefore (string $sessionKey) : void

Inherited from DeferredBinding

Internally used method to commit all deferred bindings before saving.

It is a rare need to have to call this, since it only applies to the "belongs to" relationship which generally does not need deferring.

Parameters
Property Description
$sessionKey
string
Returns
void

inherited protected commitDeferredOfType (string $sessionKey, $include = null, $exclude = null) : void

Inherited from DeferredBinding

Internal method for committing deferred relations.

Parameters
Property Description
$sessionKey
string
$include
mixed
$exclude
mixed
Returns
void

inherited protected emitterEventSortEvents (string $eventName) : void

Inherited from Emitter

Sort the listeners for a given event by priority.

Parameters
Property Description
$eventName
string
Returns
void

inherited protected extendableIsAccessible (mixed $class, string $propertyName) : bool

Inherited from ExtendableTrait

Checks if a property is accessible, property equivalent of is_callable()

Parameters
Property Description
$class
mixed
$propertyName
string
Returns
bool

inherited protected extensionCallMethod (ReflectionClass $class, string $method, array $params)

Inherited from ExtendableTrait

Calls a method through reflection.

Parameters
Property Description
$class
ReflectionClass
$method
string
$params
array
Returns
mixed

inherited protected extensionExtractMethods (string $extensionName, object $extensionObject) : void

Inherited from ExtendableTrait

Extracts the available methods from a behavior and adds it to the list of callable methods.

Parameters
Property Description
$extensionName
string
$extensionObject
object
Returns
void

inherited protected extensionGetClassLoader () : Winter\Storm\Support\ClassLoader | null

Inherited from ExtendableTrait

Gets the class loader

Returns
Winter\Storm\Support\ClassLoader | null

inherited protected extensionGetParentClass ($instance = null) : ReflectionClass | false

Inherited from ExtendableTrait

Gets the parent class using reflection.

The parent class must either not be the Extendable class, or must not be using the ExtendableTrait trait, in order to prevent infinite loops.

Parameters
Property Description
$instance
mixed
Returns
ReflectionClass | false

inherited protected extensionMethodExists (ReflectionClass $class, string $methodName) : bool

Inherited from ExtendableTrait

Determines if the given class reflection contains the given method.

Parameters
Property Description
$class
ReflectionClass
$methodName
string
Returns
bool

inherited protected extensionNormalizeClassName (string $name) : string

Inherited from ExtendableTrait

Normalizes the provided extension name allowing for the ClassLoader to inject aliased classes

Parameters
Property Description
$name
string
Returns
string

inherited protected getDeferrableRelationTypes () : array

Inherited from DeferredBinding

Returns all possible relation types that can be deferred.

Returns
array

inherited protected getDeferredBindingRecords (string $sessionKey) : Winter\Storm\Database\Collection

Inherited from DeferredBinding

Returns any outstanding binding records for this model.

Parameters
Property Description
$sessionKey
string
Returns
Winter\Storm\Database\Collection

inherited protected getMorphs (string $name, string | null $type = null, string | null $id = null) : array

Inherited from HasRelationships

Get the polymorphic relationship columns.

Parameters
Property Description
$name
string
$type
string | null
$id
string | null
Returns
array

inherited protected getRelationCaller ()

Inherited from HasRelationships

Finds the calling function name from the stack trace.

Returns
mixed

inherited protected getRelationDefaults (string $type) : array

Inherited from HasRelationships

Returns default relation arguments for a given type.

Parameters
Property Description
$type
string

Relation type

Returns
array

inherited protected getRelationValidationValue ($relationName)

Inherited from Validation

Attachments validate differently to their simple values.

Parameters
Property Description
$relationName
mixed
Returns
mixed

inherited protected getValidationAttributes () : array

Inherited from Validation

Returns the model data used for validation.

Returns
array

inherited protected handleRelation (string $relationName) : Illuminate\Database\Eloquent\Relations\Relation

Inherited from HasRelationships

Looks for the relation and does the correct magic as Eloquent would require inside relation methods. For more information, read the documentation of the mentioned property.

Parameters
Property Description
$relationName
string

the relation key, camel-case version

Returns
Illuminate\Database\Eloquent\Relations\Relation

inherited protected static makeValidator ($data, $rules, $customMessages, $attributeNames, $connection = null) : Illuminate\Contracts\Validation\Validator

Inherited from Validation

Instantiates the validator used by the validation process, depending if the class is being used inside or outside of Laravel. Optional connection string to make the validator use a different database connection than the default connection.

Parameters
Property Description
$data
mixed
$rules
mixed
$customMessages
mixed
$attributeNames
mixed
$connection
mixed
Returns
Illuminate\Contracts\Validation\Validator

inherited protected morphEagerTo (string $name, string $type, string $id, string $ownerKey) : Winter\Storm\Database\Relations\MorphTo

Inherited from HasRelationships

Define a polymorphic, inverse one-to-one or many relationship.

Parameters
Property Description
$name
string
$type
string
$id
string
$ownerKey
string
Returns

inherited protected morphInstanceTo (string $target, string $name, string $type, string $id, string | null $ownerKey = null) : Winter\Storm\Database\Relations\MorphTo

Inherited from HasRelationships

Define a polymorphic, inverse one-to-one or many relationship.

Parameters
Property Description
$target
string
$name
string
$type
string
$id
string
$ownerKey
string | null
Returns

inherited protected newBaseQueryBuilder () : Winter\Storm\Database\QueryBuilder

Inherited from Model

Get a new query builder instance for the connection.

Returns

inherited protected parseEventAndPayload (mixed $event, mixed $payload = null) : array

Inherited from Emitter

Parse the given event and payload and prepare them for dispatching.

Parameters
Property Description
$event
mixed
$payload
mixed
Returns
array

inherited protected performDeleteOnModel () : void

Inherited from Model

Perform the actual delete query on this model instance.

Returns
void

inherited protected performDeleteOnRelations () : void

Inherited from Model

Locates relations with delete flag and cascades the delete event.

For pivot relations, detach the pivot record unless the detach flag is false.

Returns
void

inherited protected processRuleFieldNames (array $rules) : array

Inherited from Validation

Processes field names in a rule array.

Converts any field names using array notation (ie. field[child]) into dot notation (ie. field.child)

Parameters
Property Description
$rules
array

Rules array

Returns
array

inherited protected processValidationRules ($rules)

Inherited from Validation

Process rules

Parameters
Property Description
$rules
mixed
Returns
mixed

inherited protected processValidationUniqueRule (string $definition, string $fieldName) : string

Inherited from Validation

Rebuilds the unique validation rule to force for the existing ID

Parameters
Property Description
$definition
string
$fieldName
string
Returns
string

inherited protected saveInternal (array $options = []) : bool

Inherited from Model

Save the model to the database. Is used by {@link save()} and {@link forceSave()}.

Parameters
Property Description
$options
array
Returns
bool

inherited protected setRelationValue ($relationName, $value)

Inherited from HasRelationships

Sets a relation value directly from its attribute.

Parameters
Property Description
$relationName
mixed
$value
mixed
Returns
mixed

inherited protected validateRelationArgs ($relationName, $optional, array $required = [])

Inherited from HasRelationships

Validate relation supplied arguments.

Parameters
Property Description
$relationName
mixed
$optional
mixed
$required
array
Returns
mixed

Extended by

Class Description
UserGroup

Administrator group

Copyright © 2024 Winter CMS