Final Class Yiisoft\Yii\Cycle\Factory\RepositoryContainer
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Psr\ |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\ |
|
| get() | Yiisoft\ |
|
| has() | Yiisoft\ |
Method Details
| public mixed __construct ( \ | ||
| $rootContainer | \ |
|
public function __construct(ContainerInterface $rootContainer)
{
$this->orm = $rootContainer->get(ORMInterface::class);
}
| public mixed get ( mixed $id ) | ||
| $id | mixed | |
public function get($id)
{
if (isset($this->instances[$id])) {
return $this->instances[$id];
}
if ($this->has($id)) {
return $this->instances[$id] = $this->makeRepository($this->roles[$id]);
}
if (!is_subclass_of($id, RepositoryInterface::class)) {
throw new NotInstantiableClassException($id);
}
throw new NotFoundException($id);
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.