1 <?php
declare(strict_types
=1);
4 * this file is part of the rapsys packbundle package.
6 * (c) raphaël gertz <symfony@rapsys.eu>
8 * for the full copyright and license information, please view the license
9 * file that was distributed with this source code.
12 namespace Rapsys\AirBundle\Entity
;
14 use Doctrine\Common\Collections\ArrayCollection
;
15 use Doctrine\ORM\Event\PreUpdateEventArgs
;
77 * @var ArrayCollection
82 * @var ArrayCollection
87 * @var ArrayCollection
94 public function __construct() {
95 $this->sessions
= new ArrayCollection();
96 $this->snippets
= new ArrayCollection();
97 $this->users
= new ArrayCollection();
105 public function getId(): int {
112 * @param string $title
116 public function setTitle(string $title): Location
{
117 $this->title
= $title;
127 public function getTitle(): string {
134 * @param string $short
138 public function setShort(string $short): Location
{
139 $this->short
= $short;
149 public function getShort(): string {
156 * @param string $address
160 public function setAddress(string $address): Location
{
161 $this->address
= $address;
171 public function getAddress(): string {
172 return $this->address
;
178 * @param string $zipcode
182 public function setZipcode(string $zipcode): Location
{
183 $this->zipcode
= $zipcode;
193 public function getZipcode(): string {
194 return $this->zipcode
;
200 * @param string $city
204 public function setCity(string $city): Location
{
215 public function getCity(): string {
222 * @param string $latitude
226 public function setLatitude(string $latitude): Location
{
227 $this->latitude
= $latitude;
237 public function getLatitude(): string {
238 return $this->latitude
;
244 * @param string $longitude
248 public function setLongitude(string $longitude): Location
{
249 $this->longitude
= $longitude;
259 public function getLongitude(): string {
260 return $this->longitude
;
266 * @param boolean $hotspot
270 public function setHotspot(bool $hotspot): Location
{
271 $this->hotspot
= $hotspot;
281 public function getHotspot(): bool {
282 return $this->hotspot
;
288 * @param \DateTime $created
292 public function setCreated(\DateTime
$created): Location
{
293 $this->created
= $created;
303 public function getCreated(): \DateTime
{
304 return $this->created
;
310 * @param \DateTime $updated
314 public function setUpdated(\DateTime
$updated): Location
{
315 $this->updated
= $updated;
325 public function getUpdated(): \DateTime
{
326 return $this->updated
;
332 * @param Session $session
336 public function addSession(Session
$session): Location
{
337 $this->sessions
[] = $session;
345 * @param Session $session
348 public function removeSession(Session
$session): bool {
349 return $this->sessions
->removeElement($session);
355 * @return ArrayCollection
357 public function getSessions(): ArrayCollection
{
358 return $this->sessions
;
364 * @param Snippet $snippet
368 public function addSnippet(Snippet
$snippet): Location
{
369 $this->snippets
[] = $snippet;
377 * @param Snippet $snippet
380 public function removeSnippet(Snippet
$snippet): bool {
381 return $this->snippets
->removeElement($snippet);
387 * @return ArrayCollection
389 public function getSnippets(): ArrayCollection
{
390 return $this->snippets
;
400 public function addUser(User
$user): Location
{
401 $this->users
[] = $user;
412 public function removeUser(User
$user): bool {
413 return $this->users
->removeElement($user);
419 * @return ArrayCollection
421 public function getUsers(): ArrayCollection
{
428 public function preUpdate(PreUpdateEventArgs
$eventArgs) {
429 //Check that we have a location instance
430 if (($location = $eventArgs->getEntity()) instanceof Location
) {
432 $location->setUpdated(new \
DateTime('now'));
437 * Returns a string representation of the location
441 public function __toString(): string {