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


PHP Datamodel::getTableName方法代码示例

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


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

示例1: getSearchFormsAsDOM

 public function getSearchFormsAsDOM()
 {
     $vo_forms = $this->opo_dom->createElement("searchForms");
     $qr_forms = $this->opo_db->query("SELECT * FROM ca_search_forms");
     while ($qr_forms->nextRow()) {
         /** @var ca_search_forms $t_form */
         $t_form = new ca_search_forms($qr_forms->get("form_id"));
         $vo_form = $this->opo_dom->createElement("searchForm");
         $vo_form->setAttribute("code", $this->makeIDNOFromInstance($t_form, "form_code"));
         $vo_form->setAttribute("type", $this->opo_dm->getTableName($qr_forms->get("table_num")));
         $vo_form->setAttribute("system", $qr_forms->get("is_system"));
         $vo_labels = $this->opo_dom->createElement("labels");
         $qr_form_labels = $this->opo_db->query("SELECT * FROM ca_search_form_labels WHERE form_id=?", $qr_forms->get("form_id"));
         while ($qr_form_labels->nextRow()) {
             $vo_label = $this->opo_dom->createElement("label");
             $vo_label->setAttribute("locale", $this->opt_locale->localeIDToCode($qr_form_labels->get("locale_id")));
             $vo_label->appendChild($this->opo_dom->createElement("name", caEscapeForXML($qr_form_labels->get("name"))));
             $vo_labels->appendChild($vo_label);
         }
         $vo_form->appendChild($vo_labels);
         if (is_array($t_form->getSettings())) {
             $vo_settings = $this->opo_dom->createElement("settings");
             foreach ($t_form->getSettings() as $vs_setting => $va_value) {
                 if (is_array($va_value)) {
                     foreach ($va_value as $vs_value) {
                         if (!is_array($vs_value)) {
                             // ignore legacy search form settings which usually have nested arrays
                             $vo_setting = $this->opo_dom->createElement("setting", $vs_value);
                             $vo_setting->setAttribute("name", $vs_setting);
                             $vo_settings->appendChild($vo_setting);
                         }
                     }
                 } else {
                     $vo_setting = $this->opo_dom->createElement("setting", $va_value);
                     $vo_setting->setAttribute("name", $vs_setting);
                     $vo_settings->appendChild($vo_setting);
                 }
             }
             $vo_form->appendChild($vo_settings);
         }
         // User and group access
         $va_users = $t_form->getUsers();
         if (sizeof($va_users) > 0) {
             $vo_user_access = $this->opo_dom->createElement("userAccess");
             $vo_form->appendChild($vo_user_access);
             foreach ($va_users as $va_user_info) {
                 $vo_permission = $this->opo_dom->createElement("permission");
                 $vo_user_access->appendChild($vo_permission);
                 $vo_permission->setAttribute("user", $va_user_info["user_name"]);
                 $vo_permission->setAttribute("access", $this->_convertUserGroupAccessToString(intval($va_user_info['access'])));
             }
         }
         $va_groups = $t_form->getUserGroups();
         if (sizeof($va_groups) > 0) {
             $vo_group_access = $this->opo_dom->createElement("groupAccess");
             $vo_form->appendChild($vo_group_access);
             foreach ($va_groups as $va_group_info) {
                 $vo_permission = $this->opo_dom->createElement("permission");
                 $vo_group_access->appendChild($vo_permission);
                 $vo_permission->setAttribute("group", $va_group_info["code"]);
                 $vo_permission->setAttribute("access", $this->_convertUserGroupAccessToString(intval($va_group_info['access'])));
             }
         }
         $vo_placements = $this->opo_dom->createElement("bundlePlacements");
         $qr_placements = $this->opo_db->query("SELECT * FROM ca_search_form_placements WHERE form_id=? ORDER BY placement_id", $qr_forms->get("form_id"));
         while ($qr_placements->nextRow()) {
             $vo_placement = $this->opo_dom->createElement("placement");
             $vo_placement->setAttribute("code", "p" . $qr_placements->get('placement_id'));
             $vo_placements->appendChild($vo_placement);
             $vo_placement->appendChild($this->opo_dom->createElement("bundle", caEscapeForXML($qr_placements->get("bundle_name"))));
             /** @var ca_search_form_placements $t_placement */
             $t_placement = new ca_search_form_placements($qr_placements->get("placement_id"));
             if (is_array($t_placement->getSettings())) {
                 $vo_settings = $this->opo_dom->createElement("settings");
                 foreach ($t_placement->getSettings() as $vs_setting => $va_values) {
                     if (is_array($va_values)) {
                         foreach ($va_values as $vs_key => $vs_value) {
                             $vo_setting = $this->opo_dom->createElement("setting", $vs_value);
                             $vo_setting->setAttribute("name", $vs_setting);
                             if ($vs_setting == "label" || $vs_setting == "add_label") {
                                 if (is_numeric($vs_key)) {
                                     $vs_key = $this->opt_locale->localeIDToCode($vs_key);
                                 }
                                 $vo_setting->setAttribute("locale", $vs_key);
                             }
                             $vo_settings->appendChild($vo_setting);
                         }
                     } else {
                         $vo_setting = $this->opo_dom->createElement("setting", $va_values);
                         $vo_setting->setAttribute("name", $vs_setting);
                         $vo_settings->appendChild($vo_setting);
                     }
                 }
                 $vo_placement->appendChild($vo_settings);
             }
         }
         $vo_form->appendChild($vo_placements);
         $vo_forms->appendChild($vo_form);
     }
     return $vo_forms;
//.........这里部分代码省略.........
开发者ID:idiscussforum,项目名称:providence,代码行数:101,代码来源:ConfigurationExporter.php


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