| 1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- /**
- * Class LocationNote
- * @property int $id
- * @property int $location_id
- * @property int $user_id
- * @property string $content
- * @property string $dts_created
- * @property string $dts_updated
- * @property string $dts_deleted
- */
- class LocationNote extends Model {
- protected static $table = "location_note";
- protected static $id_field = "id";
- protected static $fillable_fields = ["location_id", "user_id", "content", "dts_created", "dts_updated", "dts_deleted"];
- public function getUser(): User {
- return User::get($this->user_id);
- }
- public function getLocation(): Location {
- return Location::get($this->location_id);
- }
- public function getDateTimeCreated(): DateTime {
- return new DateTime($this->dts_created, new DateTimeZone("UTC"));
- }
- public function getContentHTML(): string {
- return nl2br(htmlspecialchars($this->content));
- }
- }
|