| @@ 59-68 (lines=10) @@ | ||
| 56 | /** |
|
| 57 | * {@inheritdoc} |
|
| 58 | */ |
|
| 59 | public function loadNodeByName($title) { |
|
| 60 | $result = \Drupal::entityQuery('node') |
|
| 61 | ->condition('title', $title) |
|
| 62 | ->condition('status', NODE_PUBLISHED) |
|
| 63 | ->range(0, 1) |
|
| 64 | ->execute(); |
|
| 65 | assert($result, isNotEmpty()); |
|
| 66 | $nid = current($result); |
|
| 67 | return Node::load($nid); |
|
| 68 | } |
|
| 69 | ||
| 70 | /** |
|
| 71 | * {@inheritdoc} |
|
| @@ 118-127 (lines=10) @@ | ||
| 115 | /** |
|
| 116 | * {@inheritdoc} |
|
| 117 | */ |
|
| 118 | public function loadTaxonomyTermByName($type, $name) { |
|
| 119 | $result = \Drupal::entityQuery('taxonomy_term') |
|
| 120 | ->condition('name', $name) |
|
| 121 | ->condition('vid', $type) |
|
| 122 | ->range(0, 1) |
|
| 123 | ->execute(); |
|
| 124 | assert($result, isNotEmpty()); |
|
| 125 | $id = current($result); |
|
| 126 | return Term::load($id); |
|
| 127 | } |
|
| 128 | ||
| 129 | /** |
|
| 130 | * {@inheritdoc} |
|