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


PHP Zend_Gdata_App_Util::findGreatestBoundedValue方法代碼示例

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


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

示例1: lookupNamespace

 /**
  * Get the full version of a namespace prefix
  *
  * Looks up a prefix (atom:, etc.) in the list of registered
  * namespaces and returns the full namespace URI if
  * available. Returns the prefix, unmodified, if it's not
  * registered.
  *
  * @param string $prefix The namespace prefix to lookup.
  * @param integer $majorVersion The major protocol version in effect.
  *        Defaults to '1'.
  * @param integer $minorVersion The minor protocol version in effect.
  *        Defaults to null (use latest).
  * @return string
  */
 public function lookupNamespace($prefix, $majorVersion = 1, $minorVersion = null)
 {
     // If no match, return the prefix by default
     $result = $prefix;
     // Find tuple of keys that correspond to the namespace we should use
     if (isset($this->_namespaces[$prefix])) {
         // Major version search
         $nsData = $this->_namespaces[$prefix];
         $foundMajorV = Zend_Gdata_App_Util::findGreatestBoundedValue($majorVersion, $nsData);
         // Minor version search
         $nsData = $nsData[$foundMajorV];
         $foundMinorV = Zend_Gdata_App_Util::findGreatestBoundedValue($minorVersion, $nsData);
         // Extract NS
         $result = $nsData[$foundMinorV];
     }
     return $result;
 }
開發者ID:dragonlet,項目名稱:clearhealth,代碼行數:32,代碼來源:Base.php

示例2: lookupNamespace

 /**
  * Get the full version of a namespace prefix
  *
  * Looks up a prefix (atom:, etc.) in the list of registered
  * namespaces and returns the full namespace URI if
  * available. Returns the prefix, unmodified, if it's not
  * registered.
  *
  * @param string $prefix The namespace prefix to lookup.
  * @param integer $majorVersion The major protocol version in effect.
  *        Defaults to '1'.
  * @param integer $minorVersion The minor protocol version in effect.
  *        Defaults to null (use latest).
  * @return string
  */
 public function lookupNamespace($prefix, $majorVersion = 1, $minorVersion = null)
 {
     // Check for a memoized result
     $key = $prefix . ' ' . ($majorVersion === null ? 'NULL' : $majorVersion) . ' ' . ($minorVersion === null ? 'NULL' : $minorVersion);
     if (array_key_exists($key, self::$_namespaceLookupCache)) {
         return self::$_namespaceLookupCache[$key];
     }
     // If no match, return the prefix by default
     $result = $prefix;
     // Find tuple of keys that correspond to the namespace we should use
     if (isset($this->_namespaces[$prefix])) {
         // Major version search
         $nsData = $this->_namespaces[$prefix];
         $foundMajorV = Zend_Gdata_App_Util::findGreatestBoundedValue($majorVersion, $nsData);
         // Minor version search
         $nsData = $nsData[$foundMajorV];
         $foundMinorV = Zend_Gdata_App_Util::findGreatestBoundedValue($minorVersion, $nsData);
         // Extract NS
         $result = $nsData[$foundMinorV];
     }
     // Memoize result
     self::$_namespaceLookupCache[$key] = $result;
     return $result;
 }
開發者ID:yonetici,項目名稱:pimcore-coreshop-demo,代碼行數:39,代碼來源:Base.php

示例3: testFindGreatestBoundedValueFailsWhenNegativelyBounded

 public function testFindGreatestBoundedValueFailsWhenNegativelyBounded()
 {
     $data = array(-1 => null, 0 => null, 1 => null, 2 => null, 3 => null, 5 => null, -2 => null);
     try {
         $result = Zend_Gdata_App_Util::findGreatestBoundedValue(-1, $data);
         $failed = true;
     } catch (Zend_Gdata_App_Exception $e) {
         $failed = false;
     }
     $this->assertFalse($failed, 'Exception not raised.');
 }
開發者ID:robertfoleyjr,項目名稱:robertfoleyjr-d6,代碼行數:11,代碼來源:UtilTest.php


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