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


PHP XDB::Iterator方法代码示例

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


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

示例1: fetchProfileData

 private static function fetchProfileData(array $pids, $respect_order = true, $fields = 0x0, $visibility = null)
 {
     if (count($pids) == 0) {
         return null;
     }
     if ($respect_order) {
         $order = 'ORDER BY  ' . XDB::formatCustomOrder('p.pid', $pids);
     } else {
         $order = '';
     }
     if ($visibility === null) {
         $visibility = Visibility::defaultForRead();
     }
     $it = XDB::Iterator('SELECT  p.pid, p.hrpid, p.xorg_id, p.ax_id, p.birthdate, p.birthdate_ref,
                                  p.next_birthday, p.deathdate, p.deathdate_rec, p.sex = \'female\' AS sex,
                                  IF ({?}, p.cv, NULL) AS cv, p.medals_pub, p.alias_pub, p.email_directory,
                                  p.last_change, p.nationality1, p.nationality2, p.nationality3,
                                  IF (p.freetext_pub >= {?}, p.freetext, NULL) AS freetext,
                                  pe.entry_year, pe.grad_year, pe.promo_year, pe.program, pe.fieldid,
                                  IF ({?}, pse.text, NULL) AS section,
                                  ppn.firstname_main AS firstname, ppn.lastname_main AS lastname, IF ({?}, pn.name, NULL) AS nickname,
                                  IF (ppn.firstname_ordinary = \'\', ppn.firstname_main, ppn.firstname_ordinary) AS firstname_ordinary,
                                  IF (ppn.lastname_ordinary = \'\', ppn.lastname_main, ppn.lastname_ordinary) AS lastname_ordinary,
                                  pd.yourself, pd.promo, pd.short_name, pd.public_name AS full_name,
                                  pd.directory_name, pd.public_name, pd.private_name, pd.sort_name,
                                  IF (pp.pub >= {?}, pp.display_tel, NULL) AS mobile,
                                  (ph.pub >= {?} AND ph.attach IS NOT NULL) AS has_photo, ph.pub as photo_pub,
                                  ph.x AS photo_width, ph.y AS photo_height,
                                  p.last_change < DATE_SUB(NOW(), INTERVAL 365 DAY) AS is_old,
                                  pm.expertise AS mentor_expertise,
                                  IF ({?}, pdt.message, NULL) AS deltaten_message,
                                  ap.uid AS owner_id
                            FROM  profiles AS p
                      INNER JOIN  profile_display AS pd ON (pd.pid = p.pid)
                      INNER JOIN  profile_education AS pe ON (pe.pid = p.pid AND FIND_IN_SET(\'primary\', pe.flags))
                       LEFT JOIN  profile_section_enum AS pse ON (pse.id = p.section)
                      INNER JOIN  profile_public_names AS ppn ON (ppn.pid = p.pid)
                       LEFT JOIN  profile_private_names AS pn ON (pn.pid = p.pid AND type = \'nickname\')
                       LEFT JOIN  profile_phones AS pp ON (pp.pid = p.pid AND pp.link_type = \'user\' AND tel_type = \'mobile\')
                       LEFT JOIN  profile_photos AS ph ON (ph.pid = p.pid)
                       LEFT JOIN  profile_mentor AS pm ON (pm.pid = p.pid)
                       LEFT JOIN  profile_deltaten AS pdt ON (pdt.pid = p.pid)
                       LEFT JOIN  account_profiles AS ap ON (ap.pid = p.pid AND FIND_IN_SET(\'owner\', ap.perms))
                           WHERE  p.pid IN {?}
                        GROUP BY  p.pid
                                  ' . $order, $visibility->isVisible(Visibility::EXPORT_PRIVATE), $visibility->level(), $visibility->isVisible(Visibility::EXPORT_PRIVATE), $visibility->isVisible(Visibility::EXPORT_PRIVATE), $visibility->level(), $visibility->level(), $visibility->isVisible(Visibility::EXPORT_PRIVATE), $pids);
     return new ProfileIterator($it, $pids, $fields, $visibility);
 }
开发者ID:Ekleog,项目名称:platal,代码行数:48,代码来源:profile.php


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