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


PHP Selection::getReferencingTable方法代碼示例

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


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

示例1: related

 /**
  * Returns referencing rows.
  * @param  string
  * @param  string
  * @return GroupedSelection
  */
 public function related($key, $throughColumn = NULL)
 {
     if (strpos($key, '.') !== FALSE) {
         list($key, $throughColumn) = explode('.', $key);
     }
     list($table, $column) = $this->table->getConnection()->getDatabaseReflection()->getHasManyReference($this->table->getName(), $key);
     return $this->table->getReferencingTable($table, $throughColumn ?: $column, $this[$this->table->getPrimary()]);
 }
開發者ID:exesek,項目名稱:nette20login,代碼行數:14,代碼來源:ActiveRow.php

示例2: related

 /**
  * Returns referencing rows.
  * @param  string
  * @param  string
  * @return GroupedSelection
  */
 public function related($key, $throughColumn = NULL)
 {
     $groupedSelection = $this->table->getReferencingTable($key, $throughColumn, $this[$this->table->getPrimary()]);
     if (!$groupedSelection) {
         throw new Nette\MemberAccessException("No reference found for \${$this->table->name}->related({$key}).");
     }
     return $groupedSelection;
 }
開發者ID:ricco24,項目名稱:database,代碼行數:14,代碼來源:ActiveRow.php

示例3: related

 /**
  * Returns referencing rows.
  *
  * @param  string
  * @param  string
  *
  * @return GroupedSelection
  */
 public function related($key, $throughColumn = null)
 {
     if (strpos($key, '.') !== false) {
         list($key, $throughColumn) = explode('.', $key);
     } elseif (!$throughColumn) {
         list($key, $throughColumn) = $this->table->getConnection()->getDatabaseReflection()->getHasManyReference($this->table->getName(), $key);
     }
     return $this->table->getReferencingTable($key, $throughColumn, $this[$this->table->getPrimary()]);
 }
開發者ID:TheTypoMaster,項目名稱:SPHERE-Framework,代碼行數:17,代碼來源:ActiveRow.php

示例4: related

 /**
  * Returns referencing rows.
  * @param  string
  * @param  string
  * @param  bool
  * @return GroupedSelection
  */
 public function related($key, $throughColumn = NULL, $forceNewInstance = FALSE)
 {
     if (strpos($key, '.') !== FALSE) {
         list($key, $throughColumn) = explode('.', $key);
     } elseif (!is_string($throughColumn)) {
         list($key, $throughColumn) = $this->table->getConnection()->getDatabaseReflection()->getHasManyReference($this->table->getName(), $key);
     }
     return $this->table->getReferencingTable($key, $throughColumn, $this[$this->table->getPrimary()], $forceNewInstance);
 }
開發者ID:JanVoracek,項目名稱:nette,代碼行數:16,代碼來源:ActiveRow.php

示例5: related

 /**
  * Returns referencing rows.
  * @param  string table name
  * @return GroupedSelection
  */
 public function related($table)
 {
     $referencing = $this->table->getReferencingTable($table);
     $referencing->active = $this[$this->table->primary];
     return $referencing;
 }
開發者ID:kovkus,項目名稱:r-cms,代碼行數:11,代碼來源:ActiveRow.php


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