Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $query = Drupal::entityQuery('entity_test');
- $default_langcode_group = $query->andConditionGroup()
- ->condition('user_id', $properties[$default_langcode]['user_id'], '=', $default_langcode)
- ->condition('name', $properties[$default_langcode]['name'], '=', $default_langcode);
- $langcode_group = $query->andConditionGroup()
- ->condition('name', $properties[$langcode]['name'], '=', $langcode)
- ->condition("$this->field_name.value", $field_value, '=', $langcode);
- $result = $query
- ->condition('langcode', $default_langcode)
- ->condition($default_langcode_group)
- ->condition($langcode_group)
- ->sort('name', 'ASC', $default_langcode)
- ->execute();
- $query = Drupal::entityQuery('node')
- ->condition('status', 1)
- ->condition('changed', REQUEST_TIME, '<')
- ->condition('title', 'cat', 'CONTAINS')
- ->condition('field_tags.entity.name', 'cats');
- $nids = $query->execute();
- $nodes = Drupal::entityTypeManager()
- ->getStorage('node')
- ->loadByProperties(['title' => $title]);
- if ($node = reset($nodes)) {
- // found $node that matches the title
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement