BuilderHelper
class BuilderHelper
Resolve the builders and queries that Eloquent models forward their calls to, as the runtime does.
Methods
Create a builder helper.
Determine whether the builder passes the method through to its base query.
Return the declared types of the queries a builder forwards to: its stored query, which ordinary forwarded calls run on, and the query passthru calls run on.
Bind a forwarded query's row types to the model, without changing raw-query types.
Return the builder type holding the model, as Model::newModelQuery() binds it through setModel().
Return the builder type the model creates, with the given model type bound to it.
Return an active template type from a class ancestor.
Determine whether a class owns a native or documented method, which a forwarded method would not replace.
Details
at line 59
__construct(ReflectionProvider $reflectionProvider, DeclarationDependencyTracker $declarationDependencyTracker, AttributeClassNameResolver $attributeClassNames)
Create a builder helper.
at line 70
bool
isPassthru(ClassReflection $builderClass, string $methodName)
Determine whether the builder passes the method through to its base query.
at line 94
array
queryTypes(ClassReflection $builderClass)
Return the declared types of the queries a builder forwards to: its stored query, which ordinary forwarded calls run on, and the query passthru calls run on.
Builder::__call() passes passthru calls to toBase() and forwards others to the stored query. Read
through getMethod(), so a @method tag counts, as packages replacing the query layer (such as
mongodb/laravel-mongodb) declare it on toBase().
at line 112
Type
bindQueryRows(Type $queryType, Type $modelType)
Bind a forwarded query's row types to the model, without changing raw-query types.
at line 144
Type
getBuilderType(Type $builderType, Type $modelType)
Return the builder type holding the model, as Model::newModelQuery() binds it through setModel().
setModel() rebinds only the template mapped to the Eloquent builder's model, so other type arguments and a builder that fixes its model keep their declarations.
at line 281
Type|null
determineBuilderClass(string $modelClassName, Type $modelType, bool $modelQuery = false)
Return the builder type the model creates, with the given model type bound to it.
at line 306
Type
templateType(ClassReflection $classReflection, string $ancestorClass, string $templateName)
Return an active template type from a class ancestor.
at line 323
bool
hasNativeOrDocumentedMethod(ClassReflection $classReflection, string $methodName)
Determine whether a class owns a native or documented method, which a forwarded method would not replace.