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


PHP self::getFromDB方法代码示例

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


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

示例1: loadInSession

 static function loadInSession()
 {
     unset($_SESSION['talk_userprefs']);
     $self = new self();
     if ($self->getFromDB(Session::getLoginUserID())) {
         $_SESSION['talk_userprefs'] = $self->fields;
     } else {
         $self->add(array('users_id' => Session::getLoginUserID()));
         $self->getFromDB(Session::getLoginUserID());
         $_SESSION['talk_userprefs'] = $self->fields;
     }
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:12,代码来源:userpref.class.php

示例2: showFormAlerts

 static function showFormAlerts($target)
 {
     $self = new self();
     $self->getFromDB(1);
     echo "<form action='{$target}' method='post'>";
     echo "<input type='hidden' name='id' value='1'>";
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('Reminders frequency', 'additionalalerts') . " " . PluginAdditionalalertsInfocomAlert::getTypeName(2) . "</td><td>";
     Alert::dropdownYesNo(array('name' => "use_infocom_alert", 'value' => $self->fields["use_infocom_alert"]));
     echo "</td></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td >" . __('Reminders frequency', 'additionalalerts') . " " . __('New imported computers from OCS-NG', 'additionalalerts') . "</td><td>";
     Alert::dropdownYesNo(array('name' => "use_newocs_alert", 'value' => $self->fields["use_newocs_alert"]));
     echo "</td></tr>";
     echo "<tr class='tab_bg_2'><td >" . __('OCS-NG Synchronization alerts', 'additionalalerts') . "</td><td>";
     Alert::dropdownIntegerNever('delay_ocs', $self->fields["delay_ocs"], array('max' => 99));
     echo "&nbsp;" . _n('Day', 'Days', 2) . "</td></tr>";
     echo "</td></tr>";
     echo "<tr class='tab_bg_2'><td class='center' colspan='2'>";
     echo "<input type='hidden' name='id' value='1'>";
     echo "<input class='submit' type='submit' name='update' value='" . _sx('button', 'Save') . "'>";
     echo "</td></tr>";
     echo "</table>";
     Html::closeForm();
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:26,代码来源:config.class.php

示例3: createFirstConfig

 static function createFirstConfig()
 {
     $conf = new self();
     if (!$conf->getFromDB(1)) {
         $conf->add(array('id' => 1, 'add_waiting' => 1));
     }
 }
开发者ID:pluginsGLPI,项目名称:timelineticket,代码行数:7,代码来源:config.class.php

示例4: showForGroup

 static function showForGroup(Group $group)
 {
     global $DB;
     $ID = $group->getField('id');
     if (!$group->can($ID, READ)) {
         return false;
     }
     $canedit = $group->can($ID, UPDATE);
     if ($canedit) {
         // Get data
         $item = new self();
         if (!$item->getFromDB($ID)) {
             $item->getEmpty();
         }
         $rand = mt_rand();
         echo "<form name='group_level_form{$rand}' id='group_level_form{$rand}' method='post'\n                action='" . Toolbox::getItemTypeFormURL(__CLASS__) . "'>";
         echo "<input type='hidden' name='" . self::$items_id . "' value='{$ID}' />";
         echo "<div class='spaced'>";
         echo "<table class='tab_cadre_fixe'>";
         echo "<tr class='tab_bg_1'><th>" . __('Level attribution', 'itilcategorygroups') . "</th></tr>";
         echo "<tr class='tab_bg_2'><td class='center'>";
         Dropdown::showFromArray('lvl', array(NULL => "---", 1 => __('Level 1', 'itilcategorygroups'), 2 => __('Level 2', 'itilcategorygroups'), 3 => __('Level 3', 'itilcategorygroups'), 4 => __('Level 4', 'itilcategorygroups')), array('value' => $item->fields['lvl']));
         echo "</td></tr>";
         echo "</td><td class='center'>";
         if ($item->fields["id"]) {
             echo "<input type='hidden' name='id' value='" . $item->fields["id"] . "'>";
             echo "<input type='submit' name='update' value=\"" . __('Save') . "\"\n                   class='submit'>";
         } else {
             echo "<input type='submit' name='add' value=\"" . __('Save') . "\" class='submit'>";
         }
         echo "</td></tr>";
         echo "</table></div>";
         Html::closeForm();
     }
 }
开发者ID:erchbox,项目名称:itilcategorygroups,代码行数:35,代码来源:group_level.class.php

示例5: changeGroup

 static function changeGroup()
 {
     $grp = new self();
     if ($grp->getFromDB($_SESSION['glpiactiveprofile']['id'])) {
         $_SESSION["glpi_plugin_vip_profile"] = $grp->fields;
     } else {
         unset($_SESSION["glpi_plugin_vip_profile"]);
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:9,代码来源:group.class.php

示例6: changeprofile

 static function changeprofile()
 {
     $prof = new self();
     if ($prof->getFromDB($_SESSION['glpiactiveprofile']['id'])) {
         $_SESSION["glpi_plugin_customfields_profiles"] = $prof->fields;
     } else {
         unset($_SESSION["glpi_plugin_customfields_profiles"]);
     }
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:9,代码来源:profile.class.php

示例7: changeprofile

 static function changeprofile()
 {
     $tmp = new self();
     if ($tmp->getFromDB($_SESSION['glpiactiveprofile']['id'])) {
         $_SESSION["glpi_plugin_winadminpassword_profile"] = $tmp->fields;
     } else {
         unset($_SESSION["glpi_plugin_winadminpassword_profile"]);
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:9,代码来源:profile.class.php

示例8: select

 static function select()
 {
     $prof = new self();
     if ($prof->getFromDB($_SESSION['glpiactiveprofile']['id'])) {
         $_SESSION["glpi_plugin_appliances_profiles"] = $prof->fields;
     } else {
         unset($_SESSION["glpi_plugin_appliances_profiles"]);
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:9,代码来源:profile.class.php

示例9: changeProfile

 static function changeProfile()
 {
     $profil = new self();
     if ($profil->getFromDB($_SESSION['glpiactiveprofile']['id'])) {
         $_SESSION["glpi_plugin_ticketmail_profile"] = $profil->fields;
     } else {
         unset($_SESSION["glpi_plugin_ticketmail_profile"]);
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:9,代码来源:profile.class.php

示例10: getStatusColor

 static function getStatusColor($ID)
 {
     $self = new self();
     if ($self->getFromDB($ID)) {
         if (!empty($self->fields['color'])) {
             return $self->fields['color'];
         }
     }
     return "#CCCCCC";
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:10,代码来源:projetstate.class.php

示例11: changeprofile

 static function changeprofile()
 {
     if (isset($_SESSION['glpiactiveprofile']['id'])) {
         $tmp = new self();
         if ($tmp->getFromDB($_SESSION['glpiactiveprofile']['id'])) {
             $_SESSION["glpi_plugin_surveyticket_profile"] = $tmp->fields;
         } else {
             unset($_SESSION["glpi_plugin_surveyticket_profile"]);
         }
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:11,代码来源:profile.class.php

示例12: getConfig

 static function getConfig($update = false)
 {
     static $config = null;
     if (is_null($config)) {
         $config = new self();
     }
     if ($update) {
         $config->getFromDB(1);
     }
     return $config;
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:11,代码来源:config.class.php

示例13: transfer

 static function transfer($ID, $entity)
 {
     global $DB;
     $temp = new self();
     if ($ID <= 0 || !$temp->getFromDB($ID)) {
         return 0;
     }
     $query = "SELECT `id`\n                FROM `" . $temp->getTable() . "`\n                WHERE `entities_id` = '" . $entity . "'\n                      AND `name` = '" . addslashes($temp->fields['name']) . "'";
     foreach ($DB->request($query) as $data) {
         return $data['id'];
     }
     $input = $temp->fields;
     $input['entities_id'] = $entity;
     unset($input['id']);
     return $temp->add($input);
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:16,代码来源:appliancetype.class.php

示例14: checkWizardSetup

 static function checkWizardSetup($ID, $field)
 {
     global $DB;
     if ($ID > 0) {
         $resource = new PluginResourcesResource();
         $self = new self();
         if ($resource->getFromDB($ID)) {
             if ($self->getFromDB($resource->fields["plugin_resources_contracttypes_id"])) {
                 if ($self->fields[$field] > 0) {
                     return true;
                 }
             }
         }
     }
     return false;
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:16,代码来源:contracttype.class.php

示例15: showForItemtype

 static function showForItemtype($type)
 {
     global $DB;
     if (!Session::haveRight("profile", "r")) {
         return false;
     }
     $canedit = Session::haveRight("profile", "w");
     echo "<form action='" . Toolbox::getItemTypeSearchURL(__CLASS__) . "' method='post'>";
     echo "<table class='tab_cadre_fixe'>";
     $itemtype = $type->fields['itemtype'];
     echo "<tr><th colspan='2' align='center'><strong>";
     echo __("Rights assignment") . ":&nbsp;";
     echo $itemtype::getTypeName();
     echo "</strong></th></tr>";
     foreach (getAllDatasFromTable('glpi_profiles') as $profile) {
         echo "<tr><th colspan='2' align='center'><strong>";
         echo __("Profile") . " " . $profile['name'] . "</strong></th></tr>";
         $pgf_find = self::getProfileforItemtype($profile['id'], $itemtype);
         if (!count($pgf_find) > 0) {
             self::createAccess($profile['id']);
             $pgf_find = self::getProfileforItemtype($profile['id'], $itemtype);
         }
         $PluginGenericobjectProfile = new self();
         $PluginGenericobjectProfile->getFromDB($pgf_find['id']);
         $prefix = "profiles[" . $pgf_find['id'] . "]";
         if ($profile['interface'] == 'central') {
             echo "<tr class='tab_bg_2'>";
             echo "<td>" . __("Access object", "genericobject") . ":</td><td>";
             Profile::dropdownNoneReadWrite($prefix . "[right]", $PluginGenericobjectProfile->fields['right'], 1, 1, 1);
             echo "</td></tr>";
         }
         if ($type->canUseTickets()) {
             echo "<tr class='tab_bg_2'>";
             echo "<td>" . __("Associate tickets to this object", "genericobject") . ":</td><td>";
             Dropdown::showYesNo($prefix . "[open_ticket]", $PluginGenericobjectProfile->fields['open_ticket']);
             echo "</td></tr>";
         }
     }
     if ($canedit) {
         echo "<tr class='tab_bg_1'>";
         echo "<td align='center' colspan='2'>";
         echo "<input type='submit' name='update_all_rights' value=\"" . _sx('button', 'Post') . "\" class='submit'>";
         echo "</td></tr>";
     }
     echo "</table>";
     Html::closeForm();
 }
开发者ID:rambeau,项目名称:genericobject,代码行数:47,代码来源:profile.class.php


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