orderby example

->execute();
  }

  /** * {@inheritdoc} */
  public function getNodeTerms(array $nids, array $vids = []$langcode = NULL) {
    $query = $this->database->select($this->getDataTable(), 'td');
    $query->innerJoin('taxonomy_index', 'tn', '[td].[tid] = [tn].[tid]');
    $query->fields('td', ['tid']);
    $query->addField('tn', 'nid', 'node_nid');
    $query->orderby('td.weight');
    $query->orderby('td.name');
    $query->condition('tn.nid', $nids, 'IN');
    $query->addTag('taxonomy_term_access');
    if (!empty($vids)) {
      $query->condition('td.vid', $vids, 'IN');
    }
    if (!empty($langcode)) {
      $query->condition('td.langcode', $langcode);
    }

    $results = [];
    
->condition('ml.router_path', ['admin/build/menu-customize/%', 'admin/structure/menu/manage/%'], 'NOT IN');
    $condition = $query->orConditionGroup()
      ->condition('ml.customized', 1)
      ->condition($and);
    $query->condition($condition);
    if (isset($this->configuration['menu_name'])) {
      $query->condition('ml.menu_name', (array) $this->configuration['menu_name'], 'IN');
    }
    $query->leftJoin('menu_links', 'pl', '[ml].[plid] = [pl].[mlid]');
    $query->addField('pl', 'link_path', 'parent_link_path');
    $query->orderBy('ml.depth');
    $query->orderby('ml.mlid');
    return $query;
  }

  /** * {@inheritdoc} */
  public function fields() {
    $fields = [
      'menu_name' => $this->t("The menu name. All links with the same menu name (such as 'navigation') are part of the same menu."),
      'mlid' => $this->t('The menu link ID (mlid) is the integer primary key.'),
      'plid' => $this->t('The parent link ID (plid) is the mlid of the link above in the hierarchy, or zero if the link is at the top level in its menu.'),
      
Home | Imprint | This part of the site doesn't use cookies.