| 1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- /**
- * @property int $id
- * @property int $location_id
- * @property int $user_id
- * @property string $modifications_json
- * @property string $dts
- *
- * @method LocationUpdateLogEntry get(int $id)
- */
- 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
- */
- public function getLocation() {
- return Location::get($this->location_id);
- }
- /**
- * @return User
- */
- public function getUser() {
- return User::get($this->user_id);
- }
- public function getModifications(): array {
- return json_decode($this->modifications_json) ?: [];
- }
- }
|