| Total Complexity | 4 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | final class LocalHashTableRelationInfo implements RelationInfoInterface |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Store loaded state of entities relations |
||
| 12 | * Use the entity object as key, and boolean as value |
||
| 13 | * |
||
| 14 | * @var \WeakMap<object, bool> |
||
| 15 | */ |
||
| 16 | private $loaded; |
||
| 17 | |||
| 18 | 265 | public function __construct() |
|
| 19 | { |
||
| 20 | 265 | $this->loaded = new \WeakMap(); |
|
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * {@inheritdoc} |
||
| 25 | */ |
||
| 26 | 176 | public function isLoaded($entity): bool |
|
| 27 | { |
||
| 28 | 176 | return !empty($this->loaded[$entity]); |
|
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * {@inheritdoc} |
||
| 33 | */ |
||
| 34 | 10 | public function clear($entity): void |
|
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * {@inheritdoc} |
||
| 41 | */ |
||
| 42 | 232 | public function markAsLoaded($entity): void |
|
| 45 | } |
||
| 46 | } |
||
| 47 |