當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SelectInterface::getMetaData方法代碼示例

本文整理匯總了PHP中Drupal\Core\Database\Query\SelectInterface::getMetaData方法的典型用法代碼示例。如果您正苦於以下問題:PHP SelectInterface::getMetaData方法的具體用法?PHP SelectInterface::getMetaData怎麽用?PHP SelectInterface::getMetaData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Drupal\Core\Database\Query\SelectInterface的用法示例。


在下文中一共展示了SelectInterface::getMetaData方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: ensureFieldTable

 /**
  * Join field table if necessary.
  *
  * @param $field_name
  *   Name of the field.
  * @return string
  * @throws \Drupal\Core\Entity\Query\QueryException
  */
 protected function ensureFieldTable($index_prefix, &$field, $type, $langcode, $base_table, $entity_id_field, $field_id_field)
 {
     $field_name = $field->getName();
     if (!isset($this->fieldTables[$index_prefix . $field_name])) {
         $table = $this->sqlQuery->getMetaData('age') == EntityStorageInterface::FIELD_LOAD_CURRENT ? ContentEntityDatabaseStorage::_fieldTableName($field) : ContentEntityDatabaseStorage::_fieldRevisionTableName($field);
         if ($field->getCardinality() != 1) {
             $this->sqlQuery->addMetaData('simple_query', FALSE);
         }
         $entity_type = $this->sqlQuery->getMetaData('entity_type');
         $this->fieldTables[$index_prefix . $field_name] = $this->addJoin($type, $table, "%alias.{$field_id_field} = {$base_table}.{$entity_id_field}", $langcode);
     }
     return $this->fieldTables[$index_prefix . $field_name];
 }
開發者ID:anatalsceo,項目名稱:en-classe,代碼行數:21,代碼來源:Tables.php

示例2: addJoin

 protected function addJoin($type, $table, $join_condition, $langcode)
 {
     $arguments = array();
     if ($langcode) {
         $entity_type_id = $this->sqlQuery->getMetaData('entity_type');
         $entity_type = $this->entityManager->getDefinition($entity_type_id);
         // Only the data table follows the entity language key, dedicated field
         // tables have an hard-coded 'langcode' column.
         $langcode_key = $entity_type->getDataTable() == $table ? $entity_type->getKey('langcode') : 'langcode';
         $placeholder = ':langcode' . $this->sqlQuery->nextPlaceholder();
         $join_condition .= ' AND %alias.' . $langcode_key . ' = ' . $placeholder;
         $arguments[$placeholder] = $langcode;
     }
     return $this->sqlQuery->addJoin($type, $table, NULL, $join_condition, $arguments);
 }
開發者ID:Nikola-xiii,項目名稱:d8intranet,代碼行數:15,代碼來源:Tables.php

示例3: ensureFieldTable

 /**
  * Join field table if necessary.
  *
  * @param $field_name
  *   Name of the field.
  * @return string
  * @throws \Drupal\Core\Entity\Query\QueryException
  */
 protected function ensureFieldTable($index_prefix, &$field, $type, $langcode, $base_table, $entity_id_field, $field_id_field)
 {
     $field_name = $field->getName();
     if (!isset($this->fieldTables[$index_prefix . $field_name])) {
         $entity_type_id = $this->sqlQuery->getMetaData('entity_type');
         /** @var \Drupal\Core\Entity\Sql\DefaultTableMapping $table_mapping */
         $table_mapping = $this->entityManager->getStorage($entity_type_id)->getTableMapping();
         $table = $this->sqlQuery->getMetaData('age') == EntityStorageInterface::FIELD_LOAD_CURRENT ? $table_mapping->getDedicatedDataTableName($field) : $table_mapping->getDedicatedRevisionTableName($field);
         if ($field->getCardinality() != 1) {
             $this->sqlQuery->addMetaData('simple_query', FALSE);
         }
         $this->fieldTables[$index_prefix . $field_name] = $this->addJoin($type, $table, "%alias.{$field_id_field} = {$base_table}.{$entity_id_field}", $langcode);
     }
     return $this->fieldTables[$index_prefix . $field_name];
 }
開發者ID:davidsoloman,項目名稱:drupalconsole.com,代碼行數:23,代碼來源:Tables.php

示例4: isSimpleQuery

 /**
  * Returns whether the query requires GROUP BY and ORDER BY MIN/MAX.
  *
  * @return bool
  */
 protected function isSimpleQuery()
 {
     return !$this->pager && !$this->range && !$this->count || $this->sqlQuery->getMetaData('simple_query');
 }
開發者ID:davidsoloman,項目名稱:drupalconsole.com,代碼行數:9,代碼來源:Query.php

示例5: getMetaData

 public function getMetaData($key)
 {
     return $this->query->getMetaData($key);
 }
開發者ID:nstielau,項目名稱:drops-8,代碼行數:4,代碼來源:SelectExtender.php


注:本文中的Drupal\Core\Database\Query\SelectInterface::getMetaData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。