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


PHP Zend_Gdata_App_Util类代码示例

本文整理汇总了PHP中Zend_Gdata_App_Util的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Gdata_App_Util类的具体用法?PHP Zend_Gdata_App_Util怎么用?PHP Zend_Gdata_App_Util使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: testExceptionFormatTimestampInvalid

 public function testExceptionFormatTimestampInvalid()
 {
     $util = new Zend_Gdata_App_Util();
     try {
         $ts = Zend_Gdata_App_Util::formatTimestamp('nonsense string');
     } catch (Zend_Gdata_App_Exception $e) {
         $this->assertEquals('Invalid timestamp: nonsense string.', $e->getMessage());
     }
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:9,代码来源:UtilTest.php

示例2: testStartMinMaxParam

 public function testStartMinMaxParam()
 {
     $this->query->resetParameters();
     $startMin = '2006-10-30';
     $startMax = '2006-11-01';
     $this->query->setUser(self::GOOGLE_DEVELOPER_CALENDAR);
     $this->query->setStartMin($startMin);
     $this->query->setStartMax($startMax);
     $this->assertTrue($this->query->startMin != null);
     $this->assertTrue($this->query->startMax != null);
     $this->assertEquals(Zend_Gdata_App_Util::formatTimestamp($startMin), $this->query->getStartMin());
     $this->assertEquals(Zend_Gdata_App_Util::formatTimestamp($startMax), $this->query->getStartMax());
     $this->query->startMin = null;
     $this->assertFalse($this->query->startMin != null);
     $this->query->startMax = null;
     $this->assertFalse($this->query->startMax != null);
     $this->query->user = null;
     $this->assertFalse($this->query->user != null);
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:19,代码来源:EventQueryTest.php

示例3: setRecurrenceExpansionEnd

 /**
  * @return string recurrence-expansion-end
  */
 public function setRecurrenceExpansionEnd($value)
 {
     if ($value != null) {
         $this->_params['recurrence-expansion-end'] = Zend_Gdata_App_Util::formatTimestamp($value);
     } else {
         unset($this->_params['recurrence-expansion-end']);
     }
     return $this;
 }
开发者ID:siite,项目名称:choose-sa-cloud,代码行数:12,代码来源:EventQuery.php

示例4: 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

示例5: setPublishedMin

 /**
  * @param string $value
  * @return Zend_Gdata_Query Provides a fluent interface
  */
 public function setPublishedMin($value)
 {
     if ($value != null) {
         $this->_params['published-min'] = Zend_Gdata_App_Util::formatTimestamp($value);
     } else {
         unset($this->_params['published-min']);
     }
     return $this;
 }
开发者ID:sidramaraddy,项目名称:facebook-albums-challenge,代码行数:13,代码来源:Query.php

示例6: 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

示例7: 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

示例8: testExceptionFormatTimestampInvalidOffsetHours

 public function testExceptionFormatTimestampInvalidOffsetHours()
 {
     $util = new Zend_Gdata_App_Util();
     try {
         $ts = Zend_Gdata_App_Util::formatTimestamp('2007-06-05T02:51:12-ab:00');
     } catch (Zend_Gdata_App_Exception $e) {
         $this->assertEquals('Invalid timestamp: 2007-06-05T02:51:12-ab:00.', $e->getMessage());
         return;
     }
     // Excetion not thrown, this is bad.
     $this->fail("Exception not thrown.");
 }
开发者ID:omusico,项目名称:sugar_work,代码行数:12,代码来源:UtilTest.php


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