Skip to content

ResolvedModel

What ModelClassResolver learned about a model name: which class it names, and the two facts about that class the instantiation path needs.

Both flags come from reflection, which is why they are resolved once and cached with the class name rather than probed per call.

final readonly class ResolvedModel

Since4.0.0
SourceModel/ResolvedModel.php
PropertyTypeDescription
$classstringreadonly.
$hasConstructorboolreadonly.
$isSingletonboolreadonly.

public function __construct(class-string $class, bool $isSingleton, bool $hasConstructor): mixed

Whether the class declares a constructor. Without one, parameters go to initialize() only — passing them to new would fail.

ParameterTypeDescription
$classclass-stringThe class the model name resolved to.
$isSingletonboolWhether the class implements ISingletonModel, and so must be answered from the locator’s per-context instance cache.
$hasConstructorboolWhether the class declares a constructor. Without one, parameters go to initialize() only — passing them to new would fail.

Returns mixed