. // }}} namespace App\Entity; use DateTimeInterface; /** * Entity for Notice's location * * @category DB * @package GNUsocial * * @author Zach Copley * @copyright 2010 StatusNet Inc. * @author Mikael Nordfeldth * @copyright 2009-2014 Free Software Foundation, Inc http://www.fsf.org * @author Hugo Sales * @copyright 2020 Free Software Foundation, Inc http://www.fsf.org * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ class ActivityLocation { // {{{ Autocode private int $notice_id; private ?float $lat; private ?float $lon; private ?int $location_id; private ?int $location_ns; private DateTimeInterface $modified; public function setNoticeId(int $notice_id): self { $this->notice_id = $notice_id; return $this; } public function getNoticeId(): int { return $this->notice_id; } public function setLat(?float $lat): self { $this->lat = $lat; return $this; } public function getLat(): ?float { return $this->lat; } public function setLon(?float $lon): self { $this->lon = $lon; return $this; } public function getLon(): ?float { return $this->lon; } public function setLocationId(?int $location_id): self { $this->location_id = $location_id; return $this; } public function getLocationId(): ?int { return $this->location_id; } public function setLocationNs(?int $location_ns): self { $this->location_ns = $location_ns; return $this; } public function getLocationNs(): ?int { return $this->location_ns; } public function setModified(DateTimeInterface $modified): self { $this->modified = $modified; return $this; } public function getModified(): DateTimeInterface { return $this->modified; } // }}} Autocode public static function schemaDef(): array { return [ 'name' => 'activity_location', 'fields' => [ 'activity_id' => ['type' => 'int', 'not null' => true, 'description' => 'activity this refers to'], 'lat' => ['type' => 'numeric', 'precision' => 10, 'scale' => 7, 'description' => 'latitude'], 'lon' => ['type' => 'numeric', 'precision' => 10, 'scale' => 7, 'description' => 'longitude'], 'location_id' => ['type' => 'int', 'description' => 'location id if possible'], 'location_service' => ['type' => 'int', 'size' => 'tiny', 'description' => 'service used to retrieve location information'], 'modified' => ['type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'], ], 'primary key' => ['activity_id'], 'foreign keys' => [ 'activity_location_activity_id_fkey' => ['activity', ['activity_id' => 'id']], ], 'indexes' => [ 'activity_location_location_id_idx' => ['location_id'], ], ]; } }