| 1 | <?php |
||
| 16 | final class Resolver implements PromiseInterface |
||
| 17 | { |
||
| 18 | /** @var ORMInterface */ |
||
| 19 | private $orm; |
||
| 20 | |||
| 21 | /** @var string */ |
||
| 22 | private $role; |
||
| 23 | |||
| 24 | /** @var array */ |
||
| 25 | private $scope; |
||
| 26 | |||
| 27 | /** @var bool */ |
||
| 28 | private $loaded = false; |
||
| 29 | |||
| 30 | /** @var PromiseInterface|null */ |
||
| 31 | private $entity; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @param ORMInterface $orm |
||
| 35 | * @param string $role |
||
| 36 | * @param array $scope |
||
| 37 | */ |
||
| 38 | public function __construct(ORMInterface $orm, string $role, array $scope) |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Clone resolver and underlying entity. |
||
| 47 | */ |
||
| 48 | public function __clone() |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @inheritdoc |
||
| 57 | */ |
||
| 58 | public function __loaded(): bool |
||
| 62 | |||
| 63 | /** |
||
| 64 | * @inheritdoc |
||
| 65 | */ |
||
| 66 | public function __role(): string |
||
| 70 | |||
| 71 | /** |
||
| 72 | * @inheritdoc |
||
| 73 | */ |
||
| 74 | public function __scope(): array |
||
| 78 | |||
| 79 | /** |
||
| 80 | * @inheritdoc |
||
| 81 | */ |
||
| 82 | public function __resolve() |
||
| 93 | |||
| 94 | /** |
||
| 95 | * @return object|null |
||
| 96 | */ |
||
| 97 | private function getEntityFromHeap() |
||
| 105 | |||
| 106 | /** |
||
| 107 | * @return object|null |
||
| 108 | */ |
||
| 109 | private function getEntityFromSource() |
||
| 113 | } |
||
| 114 |