| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | public function getResource(string $identifier, string $factoryMethod = 'createNew'): ResourceInterface |
||
| 38 | { |
||
| 39 | /** @var ResourceInterface $resource */ |
||
| 40 | if ($resource = $this->repository->findOneBy([$this->uniqueColumn => $identifier])) { |
||
| 41 | return $resource; |
||
| 42 | } |
||
| 43 | |||
| 44 | return $this->factory->$factoryMethod(); |
||
| 45 | } |
||
| 46 | } |
||
| 47 |