| 12345678910111213141516171819202122232425262728293031323334 |
- <?php
- /**
- * Class LocationFile
- *
- * @property int $id
- * @property int $location_id
- * @property int $type
- * @property string $dts_uploaded
- */
- class LocationFile extends Model {
- protected static $table = "location_file";
- protected static $id_field = "id";
- protected static $fillable_fields = ["location_id", "type", "dts_uploaded"];
- const TYPE_PHOTO = 1;
- // Object methods
- /**
- * @return Location|null
- * @throws Exception
- */
- public function getLocation(): ?Location {
- return Location::get($this->location_id);
- }
- public function getPhotoURL(): string {
- return sprintf("/account/locations/%d/photos/%d", $this->location_id, $this->id);
- }
- }
|