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


PHP Tree::getTreeId方法代碼示例

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


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

示例1: get_SOUR_rows

/**
 * Find source records from the database.
 *
 * @param Tree   $tree
 * @param string $term
 *
 * @return \stdClass[]
 */
function get_SOUR_rows(Tree $tree, $term)
{
    return Database::prepare("SELECT s_id AS xref, s_gedcom AS gedcom" . " FROM `##sources`" . " WHERE s_name LIKE CONCAT('%', REPLACE(:term, ' ', '%'), '%') AND s_file = :tree_id" . " ORDER BY s_name COLLATE :collation")->execute(array('term' => $term, 'tree_id' => $tree->getTreeId(), 'collation' => I18N::collation()))->fetchAll();
}
開發者ID:tronsmit,項目名稱:webtrees,代碼行數:12,代碼來源:autocomplete.php

示例2: findPlaces

 /**
  * Search for a place name.
  *
  * @param string  $filter
  * @param Tree    $tree
  *
  * @return Place[]
  */
 public static function findPlaces($filter, Tree $tree)
 {
     $places = array();
     $rows = Database::prepare("SELECT SQL_CACHE CONCAT_WS(', ', p1.p_place, p2.p_place, p3.p_place, p4.p_place, p5.p_place, p6.p_place, p7.p_place, p8.p_place, p9.p_place)" . " FROM      `##places` AS p1" . " LEFT JOIN `##places` AS p2 ON (p1.p_parent_id = p2.p_id)" . " LEFT JOIN `##places` AS p3 ON (p2.p_parent_id = p3.p_id)" . " LEFT JOIN `##places` AS p4 ON (p3.p_parent_id = p4.p_id)" . " LEFT JOIN `##places` AS p5 ON (p4.p_parent_id = p5.p_id)" . " LEFT JOIN `##places` AS p6 ON (p5.p_parent_id = p6.p_id)" . " LEFT JOIN `##places` AS p7 ON (p6.p_parent_id = p7.p_id)" . " LEFT JOIN `##places` AS p8 ON (p7.p_parent_id = p8.p_id)" . " LEFT JOIN `##places` AS p9 ON (p8.p_parent_id = p9.p_id)" . " WHERE CONCAT_WS(', ', p1.p_place, p2.p_place, p3.p_place, p4.p_place, p5.p_place, p6.p_place, p7.p_place, p8.p_place, p9.p_place) LIKE CONCAT('%', :filter_1, '%') AND CONCAT_WS(', ', p1.p_place, p2.p_place, p3.p_place, p4.p_place, p5.p_place, p6.p_place, p7.p_place, p8.p_place, p9.p_place) NOT LIKE CONCAT('%,%', :filter_2, '%') AND p1.p_file = :tree_id" . " ORDER BY  CONCAT_WS(', ', p1.p_place, p2.p_place, p3.p_place, p4.p_place, p5.p_place, p6.p_place, p7.p_place, p8.p_place, p9.p_place) COLLATE :collation")->execute(array('filter_1' => preg_quote($filter), 'filter_2' => preg_quote($filter), 'tree_id' => $tree->getTreeId(), 'collation' => I18N::collation()))->fetchOneColumn();
     foreach ($rows as $row) {
         $places[] = new self($row, $tree);
     }
     return $places;
 }
開發者ID:tunandras,項目名稱:webtrees,代碼行數:17,代碼來源:Place.php

示例3: getCount

 /**
  * How many times has a page been viewed
  *
  * @param Tree   $tree
  * @param string $page
  * @param string $parameter
  *
  * @return int
  */
 public static function getCount(Tree $tree, $page, $parameter)
 {
     return (int) Database::prepare("SELECT page_count FROM `##hit_counter`" . " WHERE gedcom_id = :tree_id AND page_name = :page AND page_parameter = :parameter")->execute(array('tree_id' => $tree->getTreeId(), 'page' => $page, 'parameter' => $parameter))->fetchOne();
 }
開發者ID:tronsmit,項目名稱:webtrees,代碼行數:13,代碼來源:HitCounter.php


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