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


PHP Duration::fromSeconds方法代码示例

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


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

示例1: readPropertiesFromRequest

 /**
  * Read request
  */
 protected function readPropertiesFromRequest()
 {
     if ((double) Request::param('distance') > 0) {
         $this->LapDistance = min($this->Context->trackdata()->totalDistance(), (double) Request::param('distance'));
     }
     if (strlen(Request::param('time')) > 0) {
         $Time = new Duration(Request::param('time'));
         $this->LapTime = min($this->Context->trackdata()->totalTime(), $Time->seconds());
     }
     if (strlen(Request::param('demanded-time')) > 0) {
         $this->DemandedTime->fromString(Request::param('demanded-time'));
         if ($this->LapDistance > 0) {
             $this->DemandedPace->setTime($this->DemandedTime->seconds() / $this->LapDistance);
         }
     } elseif ($this->LapDistance > 0) {
         $this->DemandedTime->fromSeconds($this->Context->trackdata()->totalTime() / $this->Context->trackdata()->totalDistance() * $this->LapDistance);
         $this->DemandedPace->setTime($this->DemandedTime->seconds() / $this->LapDistance);
     }
     if (strlen(Request::param('demanded-pace')) > 0) {
         $this->DemandedPace->fromMinPerKm(Request::param('demanded-pace'));
         $this->DemandedTime->fromSeconds($this->LapDistance * $this->DemandedPace->secondsPerKm());
     } elseif ($this->DemandedPace->secondsPerKm() == 0) {
         $this->DemandedPace = $this->Context->dataview()->pace();
     }
     if (strlen(Request::param('manual-distances')) > 0) {
         $this->ManualDistances = Calculator::getDistancesFromString(Request::param('manual-distances'));
     }
     if (strlen(Request::param('manual-times')) > 0) {
         $this->ManualTimes = Calculator::getTimesFromString(Request::param('manual-times'));
     }
 }
开发者ID:guancio,项目名称:Runalyze,代码行数:34,代码来源:Window.php

示例2: foreach

    ?>
</th>
			<?php 
}
?>
		</tr>
	</thead>
	<tbody>
		<?php 
foreach ($this->Range as $sPer400m) {
    ?>
		<tr>
			<?php 
    foreach ($this->Configuration()->value('pace_distances') as $km) {
        ?>
			<?php 
        $Duration->fromSeconds($km * $sPer400m / 0.4);
        ?>
			<td><?php 
        echo $Duration->string('auto', $km >= 0.4 ? 0 : 1);
        ?>
</td>
			<?php 
    }
    ?>
		</tr>
		<?php 
}
?>
	</tbody>
</table>
开发者ID:n0rthface,项目名称:Runalyze,代码行数:31,代码来源:tpl.PaceTable.php


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