| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- /**
- * @property int $id
- * @property int $location_id
- * @property int $user_id
- * @property string $modifications_json
- * @property string $dts
- */
- class LocationUpdateLogEntry extends Model {
- protected static $table = "location_update_log_entry";
- protected static $id_field = "id";
- protected static $fillable_fields = ["location_id", "user_id", "modifications_json", "dts"];
- // Object methods
- /**
- * @return Location
- * @throws Exception
- */
- public function getLocation(): ?Location {
- return Location::get($this->location_id);
- }
- /**
- * @return User
- * @throws Exception
- */
- public function getUser(): ?User {
- return User::get($this->user_id);
- }
- /**
- * @return array
- */
- public function getModifications(): array {
- return json_decode($this->modifications_json) ?: [];
- }
- }
|