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
Returns the WHERE SQL Conditions based on the current Condition Separate function to be able to update scopes at this point in time if needed
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
No description
Removes all scopes (including Default Scopes)
Details
at line 81
Query
_scopeAll(Query $Query)
Global named scope scopeAll to use on models to return an unscoped unloaded collection
at line 119
protected ModelCollection
_scope_by(mixed $fn, mixed $parameters)
Called for scopeby Magic Function Creates a new ModelCollection and applies the passed scope
at line 132
protected ModelCollection
_scope_custom(mixed $fn)
Called for scope_ Magic Function Creates a new ModelCollection and applies the passed custom scope function
at line 32
ModelCollection
add_scope_condition(Condition|Query|string $new_condition)
Adds a condition to scope the following find functions
at line 212
Query
getScopeQuery()
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 202
protected string
getScopeQueryConditionSQL()
Returns the WHERE SQL Conditions based on the current Condition Separate function to be able to update scopes at this point in time if needed
at line 105
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 14
ModelCollection
scopeAll()
No description
at line 71
void
setModelCollectionReference(ModelCollection $modelCollectionReference)
No description
at line 49
ModelCollection
unscope($scopeName = false)
Removes all scopes (including Default Scopes)