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


PHP DatabaseCompatibilityUtil::makeTimeZoneAdjustmentContent方法代码示例

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


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

示例1: resolveTimeZoneAdjustmentForACalculatedDateTimeModifier

 /**
  * @param string $attribute
  * @return string
  */
 protected function resolveTimeZoneAdjustmentForACalculatedDateTimeModifier($attribute)
 {
     $resolvedAttribute = $this->modelToReportAdapter->resolveRealAttributeName($attribute);
     if ($this->modelToReportAdapter->getRealModelAttributeType($resolvedAttribute) == 'DateTime') {
         return DatabaseCompatibilityUtil::makeTimeZoneAdjustmentContent();
     }
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:11,代码来源:GroupByReportItemQueryBuilder.php

示例2: resolveTimeZoneAdjustmentForACalculatedDateTimeModifier

 /**
  * @return string
  */
 protected function resolveTimeZoneAdjustmentForACalculatedDateTimeModifier()
 {
     $attributeType = ModelAttributeToMixedTypeUtil::getType($this->modelAttributeToDataProviderAdapter->getModel(), $this->modelAttributeToDataProviderAdapter->getAttribute());
     if ($attributeType == 'DateTime') {
         return DatabaseCompatibilityUtil::makeTimeZoneAdjustmentContent();
     }
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:10,代码来源:ModelWhereAndJoinBuilder.php

示例3: makeYearModifierString

 public static function makeYearModifierString($tableName, $columnName, $adjustForTimeZone = false)
 {
     assert('is_string($tableName)');
     assert('is_string($columnName)');
     assert('is_bool($adjustForTimeZone)');
     $quote = DatabaseCompatibilityUtil::getQuote();
     $queryString = "{$quote}{$tableName}{$quote}.{$quote}{$columnName}{$quote}";
     if ($adjustForTimeZone) {
         $queryString .= DatabaseCompatibilityUtil::makeTimeZoneAdjustmentContent();
     }
     return "year({$queryString})";
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:12,代码来源:RedBeanModelSelectQueryAdapter.php

示例4: testMakeTimeZoneAdjustmentContent

 public function testMakeTimeZoneAdjustmentContent()
 {
     Yii::app()->user->userModel = User::getByUsername('super');
     $this->assertNull(DatabaseCompatibilityUtil::makeTimeZoneAdjustmentContent());
     $tempTimeZone = Yii::app()->user->userModel->timeZone;
     Yii::app()->user->userModel->timeZone = 'America/Chicago';
     //Deal with daylight savings time.
     $timeZoneObject = new DateTimeZone(Yii::app()->user->userModel->timeZone);
     $offsetInSeconds = $timeZoneObject->getOffset(new DateTime());
     $this->assertTrue($offsetInSeconds == -18000 || $offsetInSeconds == -21600);
     $compareContent = ' - INTERVAL ' . abs($offsetInSeconds) . ' SECOND';
     $this->assertEquals($compareContent, DatabaseCompatibilityUtil::makeTimeZoneAdjustmentContent());
     Yii::app()->user->userModel->timeZone = 'Asia/Tokyo';
     $compareContent = ' + INTERVAL 32400 SECOND';
     $this->assertEquals($compareContent, DatabaseCompatibilityUtil::makeTimeZoneAdjustmentContent());
     Yii::app()->user->userModel->timeZone = $tempTimeZone;
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:17,代码来源:DatabaseCompatibilityUtilTest.php


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