當前位置: 首頁>>代碼示例>>PHP>>正文


PHP self::find方法代碼示例

本文整理匯總了PHP中self::find方法的典型用法代碼示例。如果您正苦於以下問題:PHP self::find方法的具體用法?PHP self::find怎麽用?PHP self::find使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在self的用法示例。


在下文中一共展示了self::find方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getTabNameForItem

 public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     $env = new self();
     $found_env = $env->find();
     $nb = count($found_env);
     return self::createTabEntry(self::getTypeName($nb), $nb);
 }
開發者ID:nicholaseduardo,項目名稱:formcreator,代碼行數:7,代碼來源:category.class.php

示例2: getHistory

 static function getHistory($tickets_id, $full_history = false)
 {
     global $CFG_GLPI;
     $filter_groups_id = array();
     if ($_SESSION['plugins']['escalade']['config']['use_filter_assign_group']) {
         $groups_groups = new PluginEscaladeGroup_Group();
         $filter_groups_id = $groups_groups->getGroups($tickets_id);
         $use_filter_assign_group = true;
     } else {
         $use_filter_assign_group = false;
     }
     $plugin_dir = $full_history ? ".." : "../plugins/escalade";
     //get all line for this ticket
     $group = new Group();
     $history = new self();
     $found = $history->find("tickets_id = {$tickets_id}", "date_mod DESC");
     $nb_histories = count($found);
     //remove first line (current assign)
     $first_group = array_shift($found);
     if ($full_history) {
         //show 1st group
         echo "<div class='escalade_active'>";
         echo "&nbsp;<img src='" . $CFG_GLPI['root_doc'] . "/pics/group.png' />&nbsp;";
         if ($group->getFromDB($first_group['groups_id'])) {
             echo $group->getLink(true);
         }
         echo "</div>";
     }
     echo "<div class='escalade'>";
     //parse all lines
     $i = 0;
     foreach ($found as $key => $hline) {
         echo "<div class='escalade_history'>";
         if (!$use_filter_assign_group || isset($filter_groups_id[$hline['groups_id']])) {
             //up link and image
             echo "<a href='{$plugin_dir}/front/climb_group.php?tickets_id=" . $tickets_id . "&groups_id=" . $hline['groups_id'];
             if ($full_history) {
                 echo "&full_history=true";
             }
             echo "' title='" . __("Reassign the ticket to group", "escalade") . "' class='up_a'></a>";
         } else {
             echo "&nbsp;&nbsp;&nbsp;";
         }
         //group link
         echo "&nbsp;<img src='" . $CFG_GLPI['root_doc'] . "/pics/group.png' />&nbsp;";
         if ($group->getFromDB($hline['groups_id'])) {
             echo self::showGroupLink($group, $full_history);
         }
         echo "</div>";
         $i++;
         if ($i == self::HISTORY_LIMIT && !$full_history) {
             break;
         }
     }
     //In case there are more than 10 group changes, a popup can display historical
     if ($nb_histories - 1 > self::HISTORY_LIMIT && !$full_history) {
         echo "<a href='#' onclick='var w=window.open(\"" . $plugin_dir . "/front/popup_histories.php?tickets_id=" . $tickets_id . "\" ,\"\", \"height=500, width=250, top=100, left=100, scrollbars=yes\" ); " . "w.focus();' title='" . __("View full history", "escalade") . "'>...</a>";
     }
     echo "</div>";
 }
開發者ID:korial29,項目名稱:escalade,代碼行數:60,代碼來源:history.class.php

示例3: save

 public function save()
 {
     $value_changed = $this->getValue() != $this->getOrigValue();
     if (stripos($this->getValue(), "image/png;base64") !== false) {
         $data = substr($this->getValue(), strpos($this->getValue(), ",") + 1);
         $data = str_replace(' ', '+', $data);
         $data = base64_decode($data);
         $ext = $this->getCode() == "favicon" ? ".ico" : ".png";
         $filename = $this->getCode() . $ext;
         $filepath = Core_Model_Directory::getBasePathTo("images/default");
         if (!is_dir($filepath)) {
             mkdir($filepath, 0777, true);
         }
         if (!is_writable($filepath)) {
             throw new Exception($this->_("The folder /images/default is not writable."));
         }
         file_put_contents("{$filepath}/{$filename}", $data);
         $this->setValue("/images/default/{$this->getCode()}.{$ext}");
     }
     parent::save();
     if ($this->getCode() == "system_timezone" && $value_changed) {
         $config = new self();
         $config->find("system_territory", "code");
         $value = $this->getValue();
         $territories = Zend_Registry::get("Zend_Locale")->getTranslationList('TerritoryToTimezone');
         $territory = $value && !empty($territories[$value]) ? $territories[$value] : null;
         $data = array("code" => "system_territory", "value" => $territory);
         $config->addData($data)->save();
     }
 }
開發者ID:bklein01,項目名稱:siberian_cms_2,代碼行數:30,代碼來源:Config.php

示例4: displayTabContentForItem

 static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0)
 {
     return;
     $profile = new Profile();
     $found_profiles = $profile->find("`interface` = 'central'");
     $tab_profile = new self();
     $found_tab_profiles = $tab_profile->find("`plugin_custom_tabs_id` = " . $item->getID());
     echo "<form method='POST' action='tabprofile.form.php' />";
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr><th colspan='4'>" . __("Visibility") . "</th></tr>";
     $odd = 0;
     foreach ($found_profiles as $profiles_id => $profile_fields) {
         if ($odd % 2 === 0) {
             echo "<tr>";
         }
         echo "<td>" . $profile_fields['name'] . "</td>";
         echo "<td>";
         Dropdown::showYesNo("tab_profile[{$profiles_id}]", 0);
         echo "</td>";
         if ($odd % 2 === 1) {
             echo "</tr>";
         }
         $odd++;
     }
     if ($odd % 2 === 0) {
         echo "</tr>";
     }
     echo "<tr><td colspan='4'><div class='center'>";
     echo "<input type='submit' name='update' value=\"" . _sx('button', 'Post') . "\" class='submit'>";
     echo "</div></td></tr>";
     echo "</table>";
     Html::closeForm();
     return true;
 }
開發者ID:paisdelconocimiento,項目名稱:glpi-smartcities,代碼行數:34,代碼來源:tabprofile.class.php

示例5: getAreaByStateId

 public static function getAreaByStateId($stateId)
 {
     $stateModel = new self();
     $state = $stateModel->find($stateId);
     if ($state) {
         return self::area($state->name);
     }
     return 'west';
 }
開發者ID:mrwaim,項目名稱:AddressModel,代碼行數:9,代碼來源:State.php

示例6: getAndroidSenderId

 public static function getAndroidSenderId()
 {
     if (is_null(self::$_android_sender_id)) {
         $certificat = new self();
         $certificat->find('android_sender_id', 'type');
         self::$_android_sender_id = $certificat->getPath();
     }
     return self::$_android_sender_id;
 }
開發者ID:bklein01,項目名稱:siberian_cms_2,代碼行數:9,代碼來源:Certificate.php

示例7: countForLock

 static function countForLock(CommonGLPI $item)
 {
     $pfLock = new self();
     $a_data = current($pfLock->find("`tablename`='" . $item->getTable() . "'\n         AND `items_id`='" . $item->getID() . "'", "", 1));
     if (count($a_data) == '0') {
         return 0;
     } else {
         return count(importArrayFromDB($a_data['tablefields']));
     }
 }
開發者ID:korial29,項目名稱:fusioninventory-for-glpi,代碼行數:10,代碼來源:lock.class.php

示例8: array

 static function getTag_items($id_glpi_obj, $itemtype)
 {
     $IDs = array();
     //init
     $tagitems = new self();
     foreach ($tagitems->find("itemtype = '{$itemtype}' AND items_id = {$id_glpi_obj}") as $tagitem) {
         $IDs[] = $tagitem["plugin_tag_tags_id"];
     }
     return $IDs;
 }
開發者ID:korial29,項目名稱:tag,代碼行數:10,代碼來源:tagitem.class.php

示例9: updateProfile

 static function updateProfile($input)
 {
     $fields_profile = new self();
     foreach ($input['rights'] as $profiles_id => $right) {
         $found = $fields_profile->find("`profiles_id` = '{$profiles_id}'\n                         AND `plugin_fields_containers_id` = '" . $input['plugin_fields_containers_id'] . "'");
         $first_found = array_shift($found);
         $fields_profile->update(array('id' => $first_found['id'], 'profiles_id' => $profiles_id, 'plugin_fields_containers_id' => $input['plugin_fields_containers_id'], 'right' => $right));
     }
     return true;
 }
開發者ID:publik1974,項目名稱:fields,代碼行數:10,代碼來源:profile.class.php

示例10: getTabNameForItem

 public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     switch ($item->getType()) {
         case "PluginFormcreatorForm":
             $env = new self();
             $found_env = $env->find('plugin_formcreator_forms_id = ' . $item->getID());
             $nb = count($found_env);
             return self::createTabEntry(self::getTypeName($nb), $nb);
     }
     return '';
 }
開發者ID:nicholaseduardo,項目名稱:formcreator,代碼行數:11,代碼來源:target.class.php

示例11: self

 /**
  * Return the DAO object containing to the default row of
  * civicrm_mail_settings and cache it for further calls
  *
  * @return object  DAO with the default mail settings set
  */
 static function &defaultDAO()
 {
     static $dao = NULL;
     if (!$dao) {
         $dao = new self();
         $dao->is_default = 1;
         $dao->domain_id = CRM_Core_Config::domainID();
         $dao->find(TRUE);
     }
     return $dao;
 }
開發者ID:hguru,項目名稱:224Civi,代碼行數:17,代碼來源:MailSettings.php

示例12: cleanup

 static function cleanup($profile_list)
 {
     $subs = new self();
     $subs->profile_tag_id = $profile_list->id;
     $subs->find();
     while ($subs->fetch()) {
         $profile = Profile::getKV('id', $subs->profile_id);
         Event::handle('StartUnsubscribePeopletag', array($profile_list, $profile));
         // Delete anyway
         $subs->delete();
         Event::handle('StartUnsubscribePeopletag', array($profile_list, $profile));
     }
 }
開發者ID:bashrc,項目名稱:gnusocial-debian,代碼行數:13,代碼來源:Profile_tag_subscription.php

示例13: defaultDAO

 /**
  * Return the DAO object containing to the default row of
  * civicrm_mail_settings and cache it for further calls
  *
  * @param bool $reset
  *
  * @return CRM_Core_BAO_MailSettings
  *   DAO with the default mail settings set
  */
 public static function defaultDAO($reset = FALSE)
 {
     static $mailSettings = array();
     $domainID = CRM_Core_Config::domainID();
     if (empty($mailSettings[$domainID]) || $reset) {
         $dao = new self();
         $dao->is_default = 1;
         $dao->domain_id = $domainID;
         $dao->find(TRUE);
         $mailSettings[$domainID] = $dao;
     }
     return $mailSettings[$domainID];
 }
開發者ID:kidaa30,項目名稱:yes,代碼行數:22,代碼來源:MailSettings.php

示例14: getTabNameForItem

 /**
  * Return the name of the tab for item including forms like the config page
  *
  * @param  CommonGLPI $item         Instance of a CommonGLPI Item (The Config Item)
  * @param  integer    $withtemplate
  *
  * @return String                   Name to be displayed
  */
 public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     switch ($item->getType()) {
         case "PluginFormcreatorForm":
             $number = 0;
             $section = new PluginFormcreatorSection();
             $found = $section->find('plugin_formcreator_forms_id = ' . $item->getID());
             $tab_section = array();
             foreach ($found as $section_item) {
                 $tab_section[] = $section_item['id'];
             }
             if (!empty($tab_section)) {
                 $object = new self();
                 $found = $object->find('plugin_formcreator_sections_id IN (' . implode(', ', $tab_section) . ')');
                 $number = count($found);
             }
             return self::createTabEntry(self::getTypeName($number), $number);
     }
     return '';
 }
開發者ID:CHCI74,項目名稱:formcreator,代碼行數:28,代碼來源:question.class.php

示例15: checkVacancyPermission

 /**
  * Based on vacancy ID and/or given permission return list of permission
  * that the logged in user have or return TRUE/FALSE if the loggedin user
  * has permission in the given permission list $checkPermissions respectively
  *
  * @param int   $vacancyID  vacancy ID to retrieve its permission for loggedin user
  * @param array $checkPermissions list of permission to check if loggedin user has any of the permission for given vacancy
  * whose id = $vacancyID
  *
  * @return boolean|array
  * @access public
  * @static
  */
 public static function checkVacancyPermission($vacancyID, $checkPermissions = array(), $defaultPermissions = array())
 {
     $session = CRM_Core_Session::singleton();
     $userID = $session->get('userID');
     $vacancyPermissions = array();
     $dao = new self();
     $dao->vacancy_id = $vacancyID;
     $dao->contact_id = $userID;
     $dao->find();
     if (CRM_Core_Permission::check('administer CiviCRM')) {
         if (count($checkPermissions) && in_array('administer CiviCRM', $checkPermissions)) {
             return TRUE;
         } else {
             $vacancyPermissions[] = 'administer CiviCRM';
         }
     }
     if (empty($defaultPermissions)) {
         $defaultPermissions[] = $checkPermissions;
     }
     if (count($defaultPermissions) && CRM_Core_Permission::check($defaultPermissions)) {
         return TRUE;
     }
     while ($dao->fetch()) {
         if (count($checkPermissions)) {
             if (in_array($dao->permission, $checkPermissions)) {
                 return TRUE;
             }
         } else {
             $vacancyPermissions[] = $dao->permission;
         }
     }
     if (count($checkPermissions)) {
         return FALSE;
     }
     return $vacancyPermissions;
 }
開發者ID:JoeMurray,項目名稱:civihr,代碼行數:49,代碼來源:HRVacancyPermission.php


注:本文中的self::find方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。