| Conditions | 4 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function getQuery($id, OperationParams $operation) { |
||
| 31 | list($version, $id) = explode(':', $id); |
||
| 32 | |||
| 33 | // Check that the id is properly formatted. |
||
| 34 | if (empty($version) || empty($id)) { |
||
| 35 | return NULL; |
||
| 36 | } |
||
| 37 | |||
| 38 | $storage = $this->entityTypeManager->getStorage('graphql_query_map'); |
||
| 39 | /** @var \Drupal\graphql\Entity\QueryMapInterface $map */ |
||
| 40 | if ($map = $storage->load($version)) { |
||
| 41 | return $map->getQuery($id); |
||
| 42 | } |
||
| 43 | |||
| 44 | return NULL; |
||
| 45 | } |
||
| 46 | } |
||
| 47 |