2019-11-19 03:36:39 +00:00
|
|
|
<?php
|
|
|
|
namespace Application\Models;
|
|
|
|
|
|
|
|
use Application\Foundations\Model as DBModel;
|
2019-11-20 05:19:02 +00:00
|
|
|
use Application\Foundations\DateHelper;
|
2019-11-19 03:36:39 +00:00
|
|
|
|
|
|
|
class UserAction extends DBModel {
|
2019-11-20 05:19:02 +00:00
|
|
|
public function duration_attribute() {
|
|
|
|
if($this->expired_at == "2099-12-31 23:59:00") {
|
|
|
|
return "an indefinite amount of time";
|
|
|
|
}
|
|
|
|
$then = strtotime($this->action_at);
|
|
|
|
$now = strtotime($this->expired_at);
|
|
|
|
$measure = DateHelper::durationString($then, $now);
|
|
|
|
return $measure;
|
|
|
|
}
|
2019-11-19 03:36:39 +00:00
|
|
|
}
|