Class: ChainResolver
Full name: Azera\Db\Resolver\ChainResolver
Tries each resolver in order and returns the first successful result.
If none of the chained resolvers can resolve the name, a
ResolveException is thrown. This preserves typo detection —
an unknown name like Userr that matches no model class and no mapping
entry will throw rather than silently fall back to a literal table.
Typically used to combine a ModelResolver and a
MappingResolver as the AppContext default:
new ChainResolver(new ModelResolver(), new MappingResolver($mapping))
Public methods
__construct() ·
public function __construct(array $resolvers): mixed
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$resolvers |
array | - | Resolvers to try, in order. |
Return value
- Type:
mixed
resolve() ·
public function resolve(string $name): array
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$name |
string | - |
Return value
- Type:
array