mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
cs: Fix code style (safe rules only).
This commit is contained in:
@@ -1,25 +1,71 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Chill\MainBundle\Entity;
|
||||
|
||||
use Chill\MainBundle\Doctrine\Model\TrackCreationInterface;
|
||||
use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
|
||||
use Chill\MainBundle\Repository\LocationRepository;
|
||||
use Chill\MainBundle\Validation\Constraint\PhonenumberConstraint;
|
||||
use DateTimeImmutable;
|
||||
use DateTimeInterface;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* @ORM\Table(name="chill_main_location")
|
||||
* @ORM\Entity(repositoryClass=LocationRepository::class)
|
||||
* @DiscriminatorMap(typeProperty="type", mapping={
|
||||
* "location"=Location::class
|
||||
* })
|
||||
* "location": Location::class
|
||||
* })
|
||||
*/
|
||||
class Location implements TrackCreationInterface, TrackUpdateInterface
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="boolean", nullable=true)
|
||||
* @Serializer\Groups({"read"})
|
||||
*/
|
||||
private bool $active = true;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Address::class, cascade={"persist"})
|
||||
* @ORM\JoinColumn(nullable=true)
|
||||
* @Serializer\Groups({"read", "write"})
|
||||
*/
|
||||
private ?Address $address = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
* @Serializer\Groups({"read"})
|
||||
*/
|
||||
private bool $availableForUsers = false;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable", nullable=true)
|
||||
* @Serializer\Groups({"read"})
|
||||
*/
|
||||
private ?DateTimeImmutable $createdAt = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=User::class)
|
||||
* @Serializer\Groups({"read"})
|
||||
*/
|
||||
private ?User $createdBy = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
* @Serializer\Groups({"read", "write"})
|
||||
*/
|
||||
private ?string $email = null;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
@@ -35,13 +81,6 @@ class Location implements TrackCreationInterface, TrackUpdateInterface
|
||||
*/
|
||||
private ?LocationType $locationType = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Address::class, cascade={"persist"})
|
||||
* @ORM\JoinColumn(nullable=true)
|
||||
* @Serializer\Groups({"read", "write"})
|
||||
*/
|
||||
private ?Address $address = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
* @Serializer\Groups({"read", "write"})
|
||||
@@ -64,35 +103,11 @@ class Location implements TrackCreationInterface, TrackUpdateInterface
|
||||
*/
|
||||
private ?string $phonenumber2 = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
* @Serializer\Groups({"read", "write"})
|
||||
*/
|
||||
private ?string $email = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
* @Serializer\Groups({"read"})
|
||||
*/
|
||||
private bool $availableForUsers = false;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", nullable=true)
|
||||
* @Serializer\Groups({"read"})
|
||||
*/
|
||||
private bool $active = true;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=User::class)
|
||||
* @Serializer\Groups({"read"})
|
||||
*/
|
||||
private ?User $createdBy = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable", nullable=true)
|
||||
* @Serializer\Groups({"read"})
|
||||
*/
|
||||
private ?\DateTimeImmutable $createdAt = null;
|
||||
private ?DateTimeImmutable $updatedAt = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=User::class)
|
||||
@@ -100,14 +115,35 @@ class Location implements TrackCreationInterface, TrackUpdateInterface
|
||||
*/
|
||||
private ?User $updatedBy = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable", nullable=true)
|
||||
* @Serializer\Groups({"read"})
|
||||
*/
|
||||
private ?\DateTimeImmutable $updatedAt = null;
|
||||
public function getActive(): ?bool
|
||||
{
|
||||
return $this->active;
|
||||
}
|
||||
|
||||
public function getAddress(): ?Address
|
||||
{
|
||||
return $this->address;
|
||||
}
|
||||
|
||||
public function getAvailableForUsers(): ?bool
|
||||
{
|
||||
return $this->availableForUsers;
|
||||
}
|
||||
|
||||
public function getCreatedAt(): ?DateTimeImmutable
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
||||
public function getCreatedBy(): ?User
|
||||
{
|
||||
return $this->createdBy;
|
||||
}
|
||||
|
||||
public function getEmail(): ?string
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
@@ -119,88 +155,29 @@ class Location implements TrackCreationInterface, TrackUpdateInterface
|
||||
return $this->locationType;
|
||||
}
|
||||
|
||||
public function setLocationType(?LocationType $locationType): self
|
||||
{
|
||||
$this->locationType = $locationType;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAddress(): ?Address
|
||||
{
|
||||
return $this->address;
|
||||
}
|
||||
|
||||
public function setAddress(Address $address): self
|
||||
{
|
||||
$this->address = $address;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setName(?string $name): self
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPhonenumber1(): ?string
|
||||
{
|
||||
return $this->phonenumber1;
|
||||
}
|
||||
|
||||
public function setPhonenumber1(?string $phonenumber1): self
|
||||
{
|
||||
$this->phonenumber1 = $phonenumber1;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPhonenumber2(): ?string
|
||||
{
|
||||
return $this->phonenumber2;
|
||||
}
|
||||
|
||||
public function setPhonenumber2(?string $phonenumber2): self
|
||||
public function getUpdatedAt(): ?DateTimeImmutable
|
||||
{
|
||||
$this->phonenumber2 = $phonenumber2;
|
||||
|
||||
return $this;
|
||||
return $this->updatedAt;
|
||||
}
|
||||
|
||||
public function getEmail(): ?string
|
||||
public function getUpdatedBy(): ?User
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
public function setEmail(?string $email): self
|
||||
{
|
||||
$this->email = $email;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAvailableForUsers(): ?bool
|
||||
{
|
||||
return $this->availableForUsers;
|
||||
}
|
||||
|
||||
public function setAvailableForUsers(bool $availableForUsers): self
|
||||
{
|
||||
$this->availableForUsers = $availableForUsers;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getActive(): ?bool
|
||||
{
|
||||
return $this->active;
|
||||
return $this->updatedBy;
|
||||
}
|
||||
|
||||
public function setActive(bool $active): self
|
||||
@@ -210,9 +187,25 @@ class Location implements TrackCreationInterface, TrackUpdateInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCreatedBy(): ?User
|
||||
public function setAddress(Address $address): self
|
||||
{
|
||||
return $this->createdBy;
|
||||
$this->address = $address;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setAvailableForUsers(bool $availableForUsers): self
|
||||
{
|
||||
$this->availableForUsers = $availableForUsers;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setCreatedAt(?DateTimeInterface $createdAt): self
|
||||
{
|
||||
$this->createdAt = $createdAt;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setCreatedBy(?User $createdBy): self
|
||||
@@ -222,21 +215,46 @@ class Location implements TrackCreationInterface, TrackUpdateInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCreatedAt(): ?\DateTimeImmutable
|
||||
public function setEmail(?string $email): self
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
||||
public function setCreatedAt(?\DateTimeInterface $createdAt): self
|
||||
{
|
||||
$this->createdAt = $createdAt;
|
||||
$this->email = $email;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUpdatedBy(): ?User
|
||||
public function setLocationType(?LocationType $locationType): self
|
||||
{
|
||||
return $this->updatedBy;
|
||||
$this->locationType = $locationType;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setName(?string $name): self
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setPhonenumber1(?string $phonenumber1): self
|
||||
{
|
||||
$this->phonenumber1 = $phonenumber1;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setPhonenumber2(?string $phonenumber2): self
|
||||
{
|
||||
$this->phonenumber2 = $phonenumber2;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setUpdatedAt(?DateTimeInterface $updatedAt): self
|
||||
{
|
||||
$this->updatedAt = $updatedAt;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setUpdatedBy(?User $updatedBy): self
|
||||
@@ -245,16 +263,4 @@ class Location implements TrackCreationInterface, TrackUpdateInterface
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUpdatedAt(): ?\DateTimeImmutable
|
||||
{
|
||||
return $this->updatedAt;
|
||||
}
|
||||
|
||||
public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
|
||||
{
|
||||
$this->updatedAt = $updatedAt;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user