nextras / orm-intellij

Nextras ORM Plugin for PhpStorm
https://plugins.jetbrains.com/plugin/7912-nextras-orm
MIT License
13 stars 2 forks source link

Result of IModel->getRepository() has to be stored in variable to work properly #20

Closed mabar closed 3 years ago

mabar commented 3 years ago

It's required to store getRepository() result in variable or otherwise plugin does not provide informations related to given repository entities (e.g. UserRepository + User entity)

With variable assignment, $user is User

$userRepository = $this->model->getRepository(UserRepository::class);
$user = $userRepository->getByIdChecked(1);
assert($user instanceof User);

Without variable assignment, $user is IEntity

$user = $this->model->getRepository(UserRepository::class)->getByIdChecked(1);
assert($user instanceof IEntity);

Related to #18

hrach commented 3 years ago

Released as 0.8.1: https://github.com/nextras/orm-intellij/releases/tag/v0.8.1