ScopesTrait
trait ScopesTrait
Methods
Called for scopeby Magic Function Creates a new ModelCollection and applies the passed scope
Called for scope_ Magic Function Creates a new ModelCollection and applies the passed custom scope function
Adds a condition to scope the following find functions
Returns the Query object which is being used for building the query The function creates a new Query object if required to enable lazy loading
Registers the passed scope as default scope A default scope is present when the model is being loaded and can be removed using the unscope() function if required The passed scope must be defined in a scope[SCOPE_NAME] function e.g. scopeGroupId
Reset Scope to null
No description
No description
No description
Returns an unscoped Collection
Details
at line 100
Query
_scopeAll(Query $Query)
Global named scope scopeAll to use on models to return an unscoped unloaded collection
at line 143
protected ModelCollection
_scope_by(string $fn, array $parameters)
Called for scopeby Magic Function Creates a new ModelCollection and applies the passed scope
at line 159
protected ModelCollection
_scope_custom(string $scopeName, Query|null $Query = null)
Called for scope_ Magic Function Creates a new ModelCollection and applies the passed custom scope function
at line 34
ModelCollection
add_scope_condition(Condition|ConditionGroup|Query|string $new_condition)
Adds a condition to scope the following find functions
at line 217
Query
getScopeQuery(bool $applyDefaultScopes = true)
Returns the Query object which is being used for building the query The function creates a new Query object if required to enable lazy loading
at line 127
protected void
registerDefaultScope($scopeName)
Registers the passed scope as default scope A default scope is present when the model is being loaded and can be removed using the unscope() function if required The passed scope must be defined in a scope[SCOPE_NAME] function e.g. scopeGroupId
at line 231
void
resetScopeQuery()
Reset Scope to null
at line 81
ModelCollection
scope(string $scopeName, Query|null $scopeQuery = null)
No description
at line 16
ModelCollection
scopeAll()
No description
at line 16
ModelCollection
scope_by_id(int|array $id)
No description
at line 88
void
setModelCollectionReference(ModelCollection $modelCollectionReference)
No description
at line 56
ModelCollection
unscope(string $scopeName = null, Query|null $scopeQuery = null)
Returns an unscoped Collection