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


PHP DateTimeUtil::resolveDateAsDateTime方法代码示例

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


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

示例1: resolveValueAndSetToModel

 /**
  * Utilized to create or update model attribute values after a workflow's triggers are fired as true.
  * @param WorkflowActionProcessingModelAdapter $adapter
  * @param $attribute
  * @throws NotSupportedException
  */
 public function resolveValueAndSetToModel(WorkflowActionProcessingModelAdapter $adapter, $attribute)
 {
     assert('is_string($attribute)');
     if ($this->type == static::TYPE_STATIC) {
         $adapter->getModel()->{$attribute} = $this->value;
     } elseif ($this->type == self::TYPE_DYNAMIC_FROM_TRIGGERED_DATE) {
         $newTimeStamp = $this->resolveNewTimeStampForDuration(time());
         $adapter->getModel()->{$attribute} = DateTimeUtil::convertTimestampToDbFormatDate($newTimeStamp);
     } elseif ($this->type == self::TYPE_DYNAMIC_FROM_EXISTING_DATE) {
         if (!DateTimeUtil::isDateStringNull($adapter->getModel()->{$attribute})) {
             $existingTimeStamp = DateTimeUtil::convertDbFormatDateTimeToTimestamp(DateTimeUtil::resolveDateAsDateTime($adapter->getModel()->{$attribute}));
             $newTimeStamp = $this->resolveNewTimeStampForDuration($existingTimeStamp);
             $newDate = DateTimeUtil::convertTimestampToDbFormatDate($newTimeStamp);
             $adapter->getModel()->{$attribute} = $newDate;
         }
     } else {
         throw new NotSupportedException();
     }
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:25,代码来源:DateWorkflowActionAttributeForm.php

示例2: resolveTimeStampForDateAttributeForProcessDateTime

 /**
  * @param TimeTriggerForWorkflowForm $trigger
  * @param RedBeanModel $model
  * @return int
  * @throws ValueForProcessDateTimeIsNullException
  */
 protected static function resolveTimeStampForDateAttributeForProcessDateTime(TimeTriggerForWorkflowForm $trigger, RedBeanModel $model)
 {
     $date = static::resolveModelValueByTimeTrigger($trigger, $model);
     if (DateTimeUtil::isDateStringNull($date)) {
         throw new ValueForProcessDateTimeIsNullException();
     } else {
         return $trigger->resolveNewTimeStampForDuration(DateTimeUtil::convertDbFormatDateTimeToTimestamp(DateTimeUtil::resolveDateAsDateTime($date)));
     }
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:15,代码来源:SavedWorkflowsUtil.php

示例3: sanitizeAndResolveThirdValue

 protected function sanitizeAndResolveThirdValue()
 {
     if ($this->trigger->valueEvaluationType == 'Date') {
         $todayDate = Yii::app()->dateFormatter->format(DatabaseCompatibilityUtil::getDateFormat(), time());
         $todayDateTime = DateTimeUtil::resolveDateAsDateTime($todayDate);
         return $this->trigger->resolveNewTimeStampForThirdValueDuration(strtotime($todayDateTime));
     } elseif ($this->trigger->valueEvaluationType == 'DateTime') {
         $timeZone = date_default_timezone_get();
         date_default_timezone_set('GMT');
         $timeStamp = $this->trigger->resolveNewTimeStampForThirdValueDuration(time());
         date_default_timezone_set($timeZone);
         return $timeStamp;
     } else {
         throw new NotSupportedException();
     }
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:16,代码来源:DateTriggerRules.php


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