Final Class Yiisoft\RequestModel\RequestModelFactory
| Inheritance | Yiisoft\ |
|---|
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\ |
|
| createInstances() | Yiisoft\ |
Method Details
| public mixed __construct ( \ | ||
| $validator | \ |
|
| $injector | \ |
|
| $currentRoute | \ |
|
public function __construct(
private ValidatorInterface $validator,
private Injector $injector,
private CurrentRoute $currentRoute
) {
}
| public array createInstances ( \ | ||
| $request | \ |
|
| $handlerParams | ReflectionParameter[] | |
| throws | ReflectionException | |
|---|---|---|
public function createInstances(ServerRequestInterface $request, array $handlerParams): array
{
$requestModelInstances = [];
foreach ($this->getModelRequestClasses($handlerParams) as $modelClass) {
$requestModelInstances[] = $this->processModel($request, $this->injector->make($modelClass));
}
return $requestModelInstances;
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.