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


PHP Base::addFields方法代码示例

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


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

示例1: getFields

 static function getFields($prefix)
 {
     global $currentRequest;
     $fields = array("title", "reference", "url", "ref_date", "notes", "certainty");
     $ret = Base::addFields($prefix, $fields);
     return $ret;
 }
开发者ID:redbugz,项目名称:rootstech2013,代码行数:7,代码来源:Source.php

示例2: getFields

 static function getFields($prefix)
 {
     global $currentRequest;
     $fields = array("event_id", "etype", "descrip", "person_id", "location_id", "d1type", "date1", "d2type", "date2", "notes");
     $ret = Base::addFields($prefix, $fields);
     $ret .= ", DATE_FORMAT(" . $prefix . ".date1, " . $currentRequest->datefmt . ") AS " . $prefix . "_fdate1";
     //$ret .= ", DATE_FORMAT(".$prefix.".date2, ".$currentRequest->datefmt.") AS ".$prefix."_fdate2";
     return $ret;
 }
开发者ID:redbugz,项目名称:rootstech2013,代码行数:9,代码来源:Event.php

示例3: getFields

 static function getFields($tbl = 'p', $name = 'n', $birth = 'b', $death = 'd')
 {
     global $currentRequest;
     $fields = array("person_id", "gender");
     $ret = Base::addFields($tbl, $fields);
     $prefix = "";
     $tbl_pref = "";
     if (strlen($tbl) > 0) {
         $prefix = $tbl . "_";
         $tbl_pref = $tbl . ".";
     }
     $ret .= ", DATE_FORMAT(" . $birth . ".date1, " . $currentRequest->datefmt . ") AS " . $prefix . "DOB";
     $ret .= ", " . $birth . ".date1 AS " . $prefix . "date_of_birth";
     $ret .= ", DATE_FORMAT(" . $death . ".date1, " . $currentRequest->datefmt . ") AS " . $prefix . "DOD";
     $ret .= ", " . $death . ".date1 AS " . $prefix . "date_of_death";
     $ret .= ", " . Name::getFields($name);
     return $ret;
 }
开发者ID:redbugz,项目名称:rootstech2013,代码行数:18,代码来源:PersonDetail.php

示例4: getFields

 static function getFields($tbl)
 {
     global $currentRequest;
     $fields = array("title", "forenames", "link", "surname", "suffix", "knownas");
     return Base::addFields($tbl, $fields);
 }
开发者ID:redbugz,项目名称:rootstech2013,代码行数:6,代码来源:Name.php

示例5: getPersonDetails

 function getPersonDetails(&$search, $callback = '')
 {
     global $tblprefix, $err_listpeeps, $currentRequest;
     if ($search->queryType == Q_IND && !isset($search->person_id)) {
         return;
     }
     $use_callback = false;
     $numargs = func_num_args();
     if ($numargs > 1) {
         $use_callback = true;
     }
     $res = array();
     // create the query based on the parameters
     $query = "SELECT DISTINCT ";
     switch ($search->queryType) {
         case Q_COUNT:
             $fields = "COUNT(p.person_id) AS count ";
             break;
         default:
             $flds = array("death_reason", "mother_id", "father_id", "narrative", "updated");
             $fields = PersonDetail::getFields() . ", bl.place AS p_birth_place" . ", YEAR(b.date1) AS p_year_of_birth" . ", " . Base::addFields("p", $flds) . ", DATE_FORMAT(updated, " . $currentRequest->datefmt . ") AS ddate";
             break;
     }
     $from = " FROM " . $tblprefix . "people p ";
     $from .= PersonDetail::getJoins();
     $from .= " LEFT JOIN " . $tblprefix . "locations bl ON bl.location_id = b.location_id";
     switch ($search->queryType) {
         case Q_TYPE:
         case Q_COUNT:
             $where = " WHERE p.person_id <> -1";
             //.$search->person_id;
             break;
         default:
             $where = " WHERE p.person_id = " . $search->person_id;
             break;
     }
     // if the user is not logged in, only show people pre $restrictdate
     $where .= $this->addPersonRestriction(" AND ");
     // need the gender if listing for mother or father selection
     if (isset($search->gender)) {
         if ($search->gender != 'A') {
             $where .= " AND gender = '" . $search->gender . "'";
         }
     }
     if (isset($search->date_of_birth) && $search->date_of_birth != '') {
         $where .= " AND b.date1 <= '" . $search->date_of_birth . "'";
     }
     if (isset($search->name->surname)) {
         $where .= " AND (";
         $op = " OR ";
         if (isset($search->name->forenames)) {
             $firstname = $search->name->forenames;
             $op = " AND ";
         } else {
             $firstname = $search->name->surname;
         }
         $lastname = $search->name->surname;
         $where .= " n.forenames LIKE " . quote_smart($firstname) . $op . " n.surname LIKE " . quote_smart($lastname);
         $where .= ")";
     }
     if (isset($search->filter)) {
         $where .= " AND (" . $search->filter . ")";
     }
     $query .= $fields . $from . $where;
     // and sort the query
     if (!$use_callback) {
         if (!isset($search->count)) {
             $search->count = 10;
         }
     }
     if ($search->queryType != Q_COUNT) {
         if (isset($search->order)) {
             $query .= " ORDER BY " . $search->order;
         } else {
             $query .= " ORDER BY n.surname, n.forenames, b.date1";
         }
         $this->addLimit($search, $query);
     }
     $result = $this->runQuery($query, $err_listpeeps);
     $search->numResults = 0;
     while ($row = $this->getNextRow($result)) {
         switch ($search->queryType) {
             case Q_COUNT:
                 $search->numResults = $row["count"];
                 break;
             default:
                 $search->numResults++;
                 $per = new PersonDetail();
                 $per->loadFields($row, L_ALL, "p_");
                 $per->name->loadFields($row, "n_");
                 $per->name->person_id = $per->person_id;
                 $per->updated = $row["p_updated"];
                 $per->dupdated = $row["ddate"];
                 if ($use_callback) {
                     call_user_func($callback, $search, $per);
                 } else {
                     $res[] = $per;
                 }
                 break;
         }
//.........这里部分代码省略.........
开发者ID:redbugz,项目名称:rootstech2013,代码行数:101,代码来源:PeopleDAO.php

示例6: getFields

 static function getFields($prefix)
 {
     $fields = array("attendee_id", "event_id", "person_id", "age", "location_id", "profession", "r_status", "loc_descrip", "certified", "notes");
     $ret = Base::addFields($prefix, $fields);
     return $ret;
 }
开发者ID:redbugz,项目名称:rootstech2013,代码行数:6,代码来源:Attendee.php

示例7: getFields

 static function getFields($tbl)
 {
     $fields = array("location_id", "name", "place", "lat", "lng", "centre");
     $ret = Base::addFields($tbl, $fields);
     return $ret;
 }
开发者ID:redbugz,项目名称:rootstech2013,代码行数:6,代码来源:Location.php


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