本文整理匯總了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'));
}
}
示例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>