amdp3-metaforums/Application/Models/UserReport.php

25 lines
630 B
PHP
Raw Permalink Normal View History

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 UserReport extends DBModel {
2019-11-20 05:19:02 +00:00
public function post_attribute() {
return Post::Find($this->post_id);
}
public function post() {
return Post::Find($this->post_id);
}
public function reported_attribute() {
return User::find($this->post()->user_id);
}
public function reporter_attribute() {
return User::find($this->user_id);
}
public function elapsed_attribute() {
return DateHelper::elapsedString($this->report_date);
}
2019-11-19 03:36:39 +00:00
}