当前位置: 首页>>代码示例>>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;未经允许,请勿转载。