当前位置: 首页>>代码示例>>PHP>>正文


PHP Host::setData方法代码示例

本文整理汇总了PHP中Host::setData方法的典型用法代码示例。如果您正苦于以下问题:PHP Host::setData方法的具体用法?PHP Host::setData怎么用?PHP Host::setData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Host的用法示例。


在下文中一共展示了Host::setData方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getAllHosts

 /**
  * Get all hosts
  *@return array Set of Host objects
  */
 public static function getAllHosts($cacheMinutes = null)
 {
     $hosts = array();
     $sql = MySqlDbManager::getQueryObject();
     $sql->exec("SELECT * FROM `" . Tbl::get('TBL_HOSTS', 'Host') . "`", $cacheMinutes);
     while (($host_data = $sql->fetchRecord()) != false) {
         $h = new Host();
         Host::setData($host_data, $h);
         $hosts[] = $h;
     }
     return $hosts;
 }
开发者ID:alexamiryan,项目名称:stingle,代码行数:16,代码来源:HostManager.class.php

示例2: getLanguageHosts

 public static function getLanguageHosts(Language $lang)
 {
     $hosts = array();
     $sql = MySqlDbManager::getQueryObject();
     $sql->exec("SELECT h.* FROM `" . Tbl::get('TBL_PAGE_INFO', 'PageInfo') . "` pi \n\t\t\t\t\tLEFT JOIN `" . Host::TBL_HOSTS . "` h ON h.id = pi.host_id \n\t\t\t\t\tWHERE pi.lang_id='{$lang->id}' AND pi.host_id IS NOT NULL\n\t\t\t\t\tGROUP BY h.id");
     $hosts_data = $sql->fetchRecords();
     foreach ($hosts_data as $host_data) {
         $host = new Host();
         Host::setData($host_data, $host);
         $hosts[] = $host;
     }
     return $hosts;
 }
开发者ID:alexamiryan,项目名称:stingle,代码行数:13,代码来源:PageInfoManager.class.php

示例3: getLanguageHosts

 public static function getLanguageHosts(Language $lang, $cacheMinutes = null)
 {
     $hosts = array();
     $sql = MySqlDbManager::getQueryObject();
     $qb = new QueryBuilder();
     $qb->select(new Field('*', 'h'))->from(Tbl::get('TBL_PAGE_INFO', 'PageInfo'), 'pi')->leftJoin(Tbl::get('TBL_HOSTS', 'Host'), 'h', $qb->expr()->equal(new Field('id', 'h'), new Field('host_id', 'pi')))->where($qb->expr()->equal(new Field('lang_id', 'pi'), $lang->id))->andWhere($qb->expr()->isNotNull(new Field('host_id', 'pi')))->groupBy(new Field('id', 'h'));
     $sql->exec($qb->getSQL(), $cacheMinutes);
     $hosts_data = $sql->fetchRecords();
     foreach ($hosts_data as $host_data) {
         $host = new Host();
         Host::setData($host_data, $host);
         $hosts[] = $host;
     }
     return $hosts;
 }
开发者ID:Welvin,项目名称:stingle,代码行数:15,代码来源:PageInfoManager.class.php

示例4: getAllPairs

 /**
  * Get all possible pairs of Host Language
  *
  * @return array 2D array key is host_language_id with "host" and "language" keys with values as corresponding objects 
  */
 public static function getAllPairs($cacheMinutes = null)
 {
     $pairs = array();
     $sql = MySqlDbManager::getQueryObject();
     $sql->exec("SELECT *, hl.id host_lang_id FROM " . Tbl::get('TBL_HOST_LANGUAGE') . " hl\n\t\t\t\t\tLEFT JOIN `" . Tbl::get("TBL_LANGUAGES", "Language") . "` l ON hl.lang_id=l.id\n\t\t\t\t\tLEFT JOIN `" . Tbl::get("TBL_HOSTS", "Host") . "` h ON hl.host_id=h.id", $cacheMinutes);
     while (($row = $sql->fetchRecord()) != false) {
         $host = new Host();
         $language = new Language();
         $row["id"] = $row["lang_id"];
         Language::setData($row, $language);
         $row["id"] = $row["host_id"];
         Host::setData($row, $host);
         $pairs[$row["host_lang_id"]] = array("host" => $host, "language" => $language);
     }
     return $pairs;
 }
开发者ID:alexamiryan,项目名称:stingle,代码行数:21,代码来源:HostLanguageManager.class.php

示例5: getAllHosts

 /**
  * Get all hosts
  *@return array Set of Host objects
  */
 public static function getAllHosts(MysqlPager $pager = null, $cacheMinutes = null)
 {
     $hosts = array();
     $sql = MySqlDbManager::getQueryObject();
     $qb = new QueryBuilder();
     $qb->select(new Field('*'))->from(Tbl::get('TBL_HOSTS', 'Host'));
     if ($pager !== null) {
         $sql = $pager->executePagedSQL($qb->getSQL(), $cacheMinutes);
     } else {
         $sql->exec($qb->getSQL(), $cacheMinutes);
     }
     while (($host_data = $sql->fetchRecord()) != false) {
         $h = new Host();
         Host::setData($host_data, $h);
         $hosts[] = $h;
     }
     return $hosts;
 }
开发者ID:Welvin,项目名称:stingle,代码行数:22,代码来源:HostManager.class.php

示例6: getAllPairs

 /**
  * Get all possible pairs of Host Language
  *
  * @return array 2D array key is host_language_id with "host" and "language" keys with values as corresponding objects 
  */
 public static function getAllPairs($cacheMinutes = null)
 {
     $pairs = array();
     $sql = MySqlDbManager::getQueryObject();
     $qb = new QueryBuilder();
     $qb->select(array(new Field('*'), new Field('id', 'hl', 'host_lang_id')))->from(Tbl::get('TBL_HOST_LANGUAGE'), 'hl')->leftJoin(Tbl::get("TBL_LANGUAGES", "Language"), 'l', $qb->expr()->equal(new Field('lang_id', 'hl'), new Field('id', 'l')))->leftJoin(Tbl::get("TBL_HOSTS", "Host"), 'h', $qb->expr()->equal(new Field('host_id', 'hl'), new Field('id', 'h')));
     $sql->exec($qb->getSQL(), $cacheMinutes);
     while (($row = $sql->fetchRecord()) != false) {
         $host = new Host();
         $language = new Language();
         $row["id"] = $row["lang_id"];
         Language::setData($row, $language);
         $row["id"] = $row["host_id"];
         Host::setData($row, $host);
         $pairs[$row["host_lang_id"]] = array("host" => $host, "language" => $language);
     }
     return $pairs;
 }
开发者ID:Welvin,项目名称:stingle,代码行数:23,代码来源:HostLanguageManager.class.php


注:本文中的Host::setData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。