mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Apply rector rules: add annotation for doctrine mapping
This commit is contained in:
@@ -27,12 +27,12 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
/**
|
||||
* Address.
|
||||
*
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table(name="chill_main_address")
|
||||
*
|
||||
* @ORM\HasLifecycleCallbacks
|
||||
*/
|
||||
#[ORM\Entity]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
#[ORM\Table(name: 'chill_main_address')]
|
||||
class Address implements TrackCreationInterface, TrackUpdateInterface
|
||||
{
|
||||
use TrackCreationTrait;
|
||||
@@ -55,54 +55,39 @@ class Address implements TrackCreationInterface, TrackUpdateInterface
|
||||
*/
|
||||
final public const ADDR_REFERENCE_STATUS_REVIEWED = 'reviewed';
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=AddressReference::class)
|
||||
*/
|
||||
#[Groups(['write'])]
|
||||
#[ORM\ManyToOne(targetEntity: AddressReference::class)]
|
||||
private ?AddressReference $addressReference = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=false, options={"default": ""})
|
||||
*/
|
||||
#[Groups(['write'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
|
||||
private string $buildingName = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", options={"default": false})
|
||||
*/
|
||||
#[Groups(['write'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, options: ['default' => false])]
|
||||
private bool $confidential = false;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=false, options={"default": ""})
|
||||
*/
|
||||
#[Groups(['write'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
|
||||
private string $corridor = '';
|
||||
|
||||
/**
|
||||
* used for the CEDEX information.
|
||||
*
|
||||
* @ORM\Column(type="text", nullable=false, options={"default": ""})
|
||||
*/
|
||||
#[Groups(['write'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
|
||||
private string $distribution = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=false, options={"default": ""})
|
||||
*/
|
||||
#[Groups(['write'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
|
||||
private string $extra = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=false, options={"default": ""})
|
||||
*/
|
||||
#[Groups(['write'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
|
||||
private string $flat = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=false, options={"default": ""})
|
||||
*/
|
||||
#[Groups(['write'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
|
||||
private string $floor = '';
|
||||
|
||||
/**
|
||||
@@ -115,108 +100,89 @@ class Address implements TrackCreationInterface, TrackUpdateInterface
|
||||
*
|
||||
* @readonly
|
||||
*
|
||||
* @ORM\ManyToMany(targetEntity=GeographicalUnit::class)
|
||||
*
|
||||
* @ORM\JoinTable(
|
||||
* name="view_chill_main_address_geographical_unit",
|
||||
* joinColumns={@ORM\JoinColumn(name="address_id")},
|
||||
* inverseJoinColumns={@ORM\JoinColumn(name="geographical_unit_id")}
|
||||
* )
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: GeographicalUnit::class)]
|
||||
#[ORM\JoinTable(name: 'view_chill_main_address_geographical_unit', joinColumns: [new ORM\JoinColumn(name: 'address_id')], inverseJoinColumns: [new ORM\JoinColumn(name: 'geographical_unit_id')])]
|
||||
private Collection $geographicalUnits;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
*
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*
|
||||
* @readonly
|
||||
*/
|
||||
#[Groups(['write'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* True if the address is a "no address", aka homeless person, ...
|
||||
*
|
||||
* @ORM\Column(type="boolean", options={"default": false})
|
||||
*/
|
||||
#[Groups(['write'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, options: ['default' => false])]
|
||||
private bool $isNoAddress = false;
|
||||
|
||||
/**
|
||||
* A ThirdParty reference for person's addresses that are linked to a third party.
|
||||
*
|
||||
* @ORM\ManyToOne(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty")
|
||||
*
|
||||
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
|
||||
*/
|
||||
#[Groups(['write'])]
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\ThirdPartyBundle\Entity\ThirdParty::class)]
|
||||
#[ORM\JoinColumn(nullable: true, onDelete: 'SET NULL')]
|
||||
private ?ThirdParty $linkedToThirdParty = null;
|
||||
|
||||
/**
|
||||
* A geospatial field storing the coordinates of the Address.
|
||||
*
|
||||
* @ORM\Column(type="point", nullable=true)
|
||||
*/
|
||||
#[Groups(['write'])]
|
||||
#[ORM\Column(type: 'point', nullable: true)]
|
||||
private ?Point $point = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\PostalCode")
|
||||
*
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
*/
|
||||
|
||||
#[Groups(['write'])]
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\PostalCode::class)]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?PostalCode $postcode = null;
|
||||
|
||||
/**
|
||||
* @var self::ADDR_REFERENCE_STATUS_*
|
||||
*
|
||||
* @ORM\Column(type="text", nullable=false, options={"default": self::ADDR_REFERENCE_STATUS_MATCH})
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => self::ADDR_REFERENCE_STATUS_MATCH])]
|
||||
private string $refStatus = self::ADDR_REFERENCE_STATUS_MATCH;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable", nullable=false, options={"default": "CURRENT_TIMESTAMP"})
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: false, options: ['default' => 'CURRENT_TIMESTAMP'])]
|
||||
private \DateTimeImmutable $refStatusLastUpdate;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=false, options={"default": ""})
|
||||
*/
|
||||
#[Groups(['write'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
|
||||
private string $steps = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=false, options={"default": ""})
|
||||
*/
|
||||
#[Groups(['write'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
|
||||
private string $street = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=false, options={"default": ""})
|
||||
*/
|
||||
#[Groups(['write'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
|
||||
private string $streetNumber = '';
|
||||
|
||||
/**
|
||||
* Indicates when the address starts validation. Used to build an history
|
||||
* of address. By default, the current date.
|
||||
*
|
||||
* @ORM\Column(type="date")
|
||||
*/
|
||||
#[Groups(['write'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_MUTABLE)]
|
||||
private \DateTime $validFrom;
|
||||
|
||||
/**
|
||||
* Indicates when the address ends. Used to build an history
|
||||
* of address.
|
||||
*
|
||||
* @ORM\Column(type="date", nullable=true)
|
||||
*/
|
||||
#[Groups(['write'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_MUTABLE, nullable: true)]
|
||||
private ?\DateTime $validTo = null;
|
||||
|
||||
public function __construct()
|
||||
|
@@ -15,101 +15,70 @@ use Chill\MainBundle\Doctrine\Model\Point;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation\Groups;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table(name="chill_main_address_reference", indexes={
|
||||
*
|
||||
* @ORM\Index(name="address_refid", columns={"refId"})
|
||||
* },
|
||||
* uniqueConstraints={
|
||||
*
|
||||
* @ORM\UniqueConstraint(name="chill_main_address_reference_unicity", columns={"refId", "source"})
|
||||
* })
|
||||
*
|
||||
* @ORM\HasLifecycleCallbacks
|
||||
*/
|
||||
|
||||
#[ORM\Entity]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
#[ORM\Table(name: 'chill_main_address_reference')]
|
||||
#[ORM\Index(name: 'address_refid', columns: ['refId'])]
|
||||
#[ORM\UniqueConstraint(name: 'chill_main_address_reference_unicity', columns: ['refId', 'source'])]
|
||||
class AddressReference
|
||||
{
|
||||
/**
|
||||
* This is an internal column which is populated by database.
|
||||
*
|
||||
* This column will ease the search operations
|
||||
*
|
||||
* @ORM\Column(type="text", options={"default": ""})
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, options: ['default' => ''])]
|
||||
private string $addressCanonical = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable", nullable=true)
|
||||
*/
|
||||
#[Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true)]
|
||||
private ?\DateTimeImmutable $createdAt = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable", nullable=true)
|
||||
*/
|
||||
#[Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true)]
|
||||
private ?\DateTimeImmutable $deletedAt = null;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\GeneratedValue
|
||||
*
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
|
||||
#[Groups(['read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=false, options={"default": ""})
|
||||
*/
|
||||
#[Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
|
||||
private string $municipalityCode = '';
|
||||
|
||||
/**
|
||||
* A geospatial field storing the coordinates of the Address.
|
||||
*
|
||||
* @ORM\Column(type="point")
|
||||
*/
|
||||
#[Groups(['read'])]
|
||||
#[ORM\Column(type: 'point')]
|
||||
private ?Point $point = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\PostalCode")
|
||||
*/
|
||||
#[Groups(['read'])]
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\PostalCode::class)]
|
||||
private ?PostalCode $postcode = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=false, options={"default": ""})
|
||||
*/
|
||||
#[Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
|
||||
private string $refId = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=false, options={"default": ""})
|
||||
*/
|
||||
#[Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
|
||||
private string $source = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=false, options={"default": ""})
|
||||
*/
|
||||
#[Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
|
||||
private string $street = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=false, options={"default": ""})
|
||||
*/
|
||||
#[Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
|
||||
private string $streetNumber = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable", nullable=true)
|
||||
*/
|
||||
#[Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true)]
|
||||
private ?\DateTimeImmutable $updatedAt = null;
|
||||
|
||||
public function getCreatedAt(): ?\DateTimeImmutable
|
||||
|
@@ -16,49 +16,35 @@ use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table(name="centers")
|
||||
*/
|
||||
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'centers')]
|
||||
class Center implements HasCenterInterface, \Stringable
|
||||
{
|
||||
/**
|
||||
* @var Collection<GroupCenter>
|
||||
*
|
||||
* @ORM\OneToMany(
|
||||
* targetEntity="Chill\MainBundle\Entity\GroupCenter",
|
||||
* mappedBy="center"
|
||||
* )
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: \Chill\MainBundle\Entity\GroupCenter::class, mappedBy: 'center')]
|
||||
private Collection $groupCenters;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
*
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
|
||||
#[Serializer\Groups(['docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
#[Serializer\Groups(['docgen:read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)]
|
||||
private string $name = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
|
||||
private bool $isActive = true;
|
||||
|
||||
/**
|
||||
* @var Collection<Regroupment>
|
||||
*
|
||||
* @ORM\ManyToMany(targetEntity=Regroupment::class, mappedBy="centers")
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: Regroupment::class, mappedBy: 'centers')]
|
||||
private Collection $regroupments;
|
||||
|
||||
/**
|
||||
|
@@ -14,49 +14,38 @@ namespace Chill\MainBundle\Entity;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
|
||||
/**
|
||||
* @ORM\Table(name="chill_main_civility")
|
||||
*
|
||||
* @ORM\Entity
|
||||
*/
|
||||
|
||||
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['chill_main_civility' => Civility::class])]
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_main_civility')]
|
||||
class Civility
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="json")
|
||||
*
|
||||
* @Serializer\Context({"is-translatable": true}, groups={"docgen:read"})
|
||||
*/
|
||||
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
|
||||
private array $abbreviation = [];
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
#[Serializer\Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
|
||||
private bool $active = true;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\GeneratedValue
|
||||
*
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
|
||||
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="json")
|
||||
*
|
||||
* @Serializer\Context({"is-translatable": true}, groups={"docgen:read"})
|
||||
*/
|
||||
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
|
||||
private array $name = [];
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="float", name="ordering", nullable=true, options={"default": 0.0})
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT, name: 'ordering', nullable: true, options: ['default' => '0.0'])]
|
||||
private float $order = 0;
|
||||
|
||||
public function getAbbreviation(): array
|
||||
|
@@ -18,42 +18,38 @@ use Symfony\Component\Serializer\Annotation\Groups;
|
||||
/**
|
||||
* Country.
|
||||
*
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table(name="country")
|
||||
*
|
||||
* @ORM\Cache(usage="READ_ONLY", region="country_cache_region")
|
||||
*
|
||||
* @ORM\HasLifecycleCallbacks
|
||||
*/
|
||||
#[ORM\Entity]
|
||||
#[ORM\Cache(usage: 'READ_ONLY', region: 'country_cache_region')]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
#[ORM\Table(name: 'country')]
|
||||
class Country
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="string", length=3)
|
||||
*
|
||||
* @Context({"is-translatable": true}, groups={"docgen:read"})
|
||||
*/
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 3)]
|
||||
private string $countryCode = '';
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
*
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @var array<string, string>
|
||||
*
|
||||
* @ORM\Column(type="json")
|
||||
*
|
||||
* @Context({"is-translatable": true}, groups={"docgen:read"})
|
||||
*/
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
|
||||
private array $name = [];
|
||||
|
||||
public function getCountryCode(): string
|
||||
|
@@ -13,42 +13,30 @@ namespace Chill\MainBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table(name="chill_main_cronjob_execution")
|
||||
*/
|
||||
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_main_cronjob_execution')]
|
||||
class CronJobExecution
|
||||
{
|
||||
final public const FAILURE = 100;
|
||||
|
||||
final public const SUCCESS = 1;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable", nullable=true, options={"default": null})
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true, options: ['default' => null])]
|
||||
private ?\DateTimeImmutable $lastEnd = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable", nullable=false)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: false)]
|
||||
private \DateTimeImmutable $lastStart;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer", nullable=true, options={"default": null})
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER, nullable: true, options: ['default' => null])]
|
||||
private ?int $lastStatus = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="json", options={"default": "'{}'::jsonb", "jsonb": true})
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, options: ['default' => "'{}'::jsonb", 'jsonb' => true])]
|
||||
private array $lastExecutionData = [];
|
||||
|
||||
public function __construct(/**
|
||||
* @ORM\Column(type="text", nullable=false)
|
||||
*
|
||||
* @ORM\Id
|
||||
*/
|
||||
public function __construct(
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false)]
|
||||
#[ORM\Id]
|
||||
private string $key
|
||||
) {
|
||||
$this->lastStart = new \DateTimeImmutable('now');
|
||||
|
@@ -15,46 +15,33 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table(name="chill_main_dashboard_config_item")
|
||||
*/
|
||||
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_main_dashboard_config_item')]
|
||||
class DashboardConfigItem
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\GeneratedValue
|
||||
*
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
|
||||
#[Serializer\Groups(['dashboardConfigItem:read', 'read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string")
|
||||
*/
|
||||
#[Serializer\Groups(['dashboardConfigItem:read', 'read'])]
|
||||
#[Assert\NotNull]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING)]
|
||||
private string $type = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string")
|
||||
*/
|
||||
#[Serializer\Groups(['dashboardConfigItem:read', 'read'])]
|
||||
#[Assert\NotNull]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING)]
|
||||
private string $position = '';
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=User::class)
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
private ?User $user = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="json", options={"default": "[]", "jsonb": true})
|
||||
*/
|
||||
#[Serializer\Groups(['dashboardConfigItem:read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, options: ['default' => '[]', 'jsonb' => true])]
|
||||
private array $metadata = [];
|
||||
|
||||
public function getId(): ?int
|
||||
|
@@ -14,26 +14,19 @@ namespace Chill\MainBundle\Entity\Embeddable;
|
||||
use DateTime;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Embeddable
|
||||
*/
|
||||
#[ORM\Embeddable]
|
||||
class CommentEmbeddable
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: true)]
|
||||
private ?string $comment = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_MUTABLE, nullable: true)]
|
||||
private ?\DateTime $date = null;
|
||||
|
||||
/**
|
||||
* Embeddable does not support associations.
|
||||
*
|
||||
* @ORM\Column(type="integer", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER, nullable: true)]
|
||||
private ?int $userId = null;
|
||||
|
||||
public function getComment(): ?string
|
||||
|
@@ -14,16 +14,13 @@ namespace Chill\MainBundle\Entity\Embeddable;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Embeddable
|
||||
*/
|
||||
#[ORM\Embeddable]
|
||||
class PrivateCommentEmbeddable
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="json", nullable=false, options={"default": "{}"})
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, nullable: false, options: ['default' => '{}'])]
|
||||
private array $comments = [];
|
||||
|
||||
public function getCommentForUser(User $user): string
|
||||
|
@@ -13,43 +13,28 @@ namespace Chill\MainBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Table(name="chill_main_geographical_unit", uniqueConstraints={
|
||||
*
|
||||
* @ORM\UniqueConstraint(name="geographical_unit_refid", columns={"layer_id", "unitRefId"})
|
||||
* })
|
||||
*
|
||||
* @ORM\Entity(readOnly=true)
|
||||
*/
|
||||
|
||||
#[ORM\Entity(readOnly: true)]
|
||||
#[ORM\Table(name: 'chill_main_geographical_unit')]
|
||||
#[ORM\UniqueConstraint(name: 'geographical_unit_refid', columns: ['layer_id', 'unitRefId'])]
|
||||
class GeographicalUnit
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: true)]
|
||||
private string $geom;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\GeneratedValue
|
||||
*
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=GeographicalUnitLayer::class, inversedBy="units")
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: GeographicalUnitLayer::class, inversedBy: 'units')]
|
||||
private ?GeographicalUnitLayer $layer = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=false, options={"default": ""})
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
|
||||
private string $unitName;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=false, options={"default": ""})
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
|
||||
private string $unitRefId;
|
||||
|
||||
public function getId(): ?int
|
||||
|
@@ -16,43 +16,31 @@ use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
|
||||
/**
|
||||
* @ORM\Table(name="chill_main_geographical_unit_layer", uniqueConstraints={
|
||||
*
|
||||
* @ORM\UniqueConstraint(name="geographical_unit_layer_refid", columns={"refId"})
|
||||
* })
|
||||
*
|
||||
* @ORM\Entity
|
||||
*/
|
||||
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_main_geographical_unit_layer')]
|
||||
#[ORM\UniqueConstraint(name: 'geographical_unit_layer_refid', columns: ['refId'])]
|
||||
class GeographicalUnitLayer
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\GeneratedValue
|
||||
*
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
|
||||
#[Serializer\Groups(['read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="json", nullable=false, options={"default": "[]"})
|
||||
*/
|
||||
#[Serializer\Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, nullable: false, options: ['default' => '[]'])]
|
||||
private array $name = [];
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=false, options={"default": ""})
|
||||
*/
|
||||
#[Serializer\Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
|
||||
private string $refId = '';
|
||||
|
||||
/**
|
||||
* @var Collection<GeographicalUnit>
|
||||
*
|
||||
* @ORM\OneToMany(targetEntity=GeographicalUnit::class, mappedBy="layer")
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: GeographicalUnit::class, mappedBy: 'layer')]
|
||||
private Collection $units;
|
||||
|
||||
public function __construct()
|
||||
|
@@ -15,51 +15,32 @@ use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table(name="group_centers")
|
||||
*
|
||||
* @ORM\Cache(usage="NONSTRICT_READ_WRITE", region="acl_cache_region")
|
||||
*/
|
||||
|
||||
#[ORM\Entity]
|
||||
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE', region: 'acl_cache_region')]
|
||||
#[ORM\Table(name: 'group_centers')]
|
||||
class GroupCenter
|
||||
{
|
||||
/**
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="Chill\MainBundle\Entity\Center",
|
||||
* inversedBy="groupCenters"
|
||||
* )
|
||||
*
|
||||
* @ORM\Cache(usage="NONSTRICT_READ_WRITE")
|
||||
*/
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Center::class, inversedBy: 'groupCenters')]
|
||||
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE')]
|
||||
private ?Center $center = null;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
*
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="Chill\MainBundle\Entity\PermissionsGroup",
|
||||
* inversedBy="groupCenters")
|
||||
*
|
||||
* @ORM\Cache(usage="NONSTRICT_READ_WRITE")
|
||||
*/
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\PermissionsGroup::class, inversedBy: 'groupCenters')]
|
||||
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE')]
|
||||
private ?PermissionsGroup $permissionsGroup = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(
|
||||
* targetEntity="Chill\MainBundle\Entity\User",
|
||||
* mappedBy="groupCenters"
|
||||
* )
|
||||
*
|
||||
* @var Collection<User::class>
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: \Chill\MainBundle\Entity\User::class, mappedBy: 'groupCenters')]
|
||||
private Collection $users;
|
||||
|
||||
/**
|
||||
|
@@ -17,32 +17,30 @@ use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
/**
|
||||
* Language.
|
||||
*
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table(name="language")
|
||||
*
|
||||
* @ORM\Cache(usage="READ_ONLY", region="language_cache_region")
|
||||
*
|
||||
* @ORM\HasLifecycleCallbacks
|
||||
*/
|
||||
#[ORM\Entity]
|
||||
#[ORM\Cache(usage: 'READ_ONLY', region: 'language_cache_region')]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
#[ORM\Table(name: 'language')]
|
||||
class Language
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\Column(type="string")
|
||||
*/
|
||||
|
||||
#[Serializer\Groups(['docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING)]
|
||||
private ?string $id = null;
|
||||
|
||||
/**
|
||||
* @var string array
|
||||
*
|
||||
* @ORM\Column(type="json")
|
||||
*
|
||||
* @Serializer\Context({"is-translatable": true}, groups={"docgen:read"})
|
||||
*/
|
||||
#[Serializer\Groups(['docgen:read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
|
||||
private array $name = [];
|
||||
|
||||
/**
|
||||
|
@@ -20,102 +20,75 @@ use libphonenumber\PhoneNumber;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
|
||||
|
||||
/**
|
||||
* @ORM\Table(name="chill_main_location")
|
||||
*
|
||||
* @ORM\Entity(repositoryClass=LocationRepository::class)
|
||||
*/
|
||||
|
||||
#[DiscriminatorMap(typeProperty: 'type', mapping: ['location' => Location::class])]
|
||||
#[ORM\Entity(repositoryClass: LocationRepository::class)]
|
||||
#[ORM\Table(name: 'chill_main_location')]
|
||||
class Location implements TrackCreationInterface, TrackUpdateInterface
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="boolean", nullable=true)
|
||||
*/
|
||||
#[Serializer\Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, nullable: true)]
|
||||
private bool $active = true;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Address::class, cascade={"persist"})
|
||||
*
|
||||
* @ORM\JoinColumn(nullable=true)
|
||||
*/
|
||||
|
||||
#[Serializer\Groups(['read', 'write', 'docgen:read'])]
|
||||
#[ORM\ManyToOne(targetEntity: Address::class, cascade: ['persist'])]
|
||||
#[ORM\JoinColumn(nullable: true)]
|
||||
private ?Address $address = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
#[Serializer\Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
|
||||
private bool $availableForUsers = false;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable", nullable=true)
|
||||
*/
|
||||
#[Serializer\Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true)]
|
||||
private ?\DateTimeImmutable $createdAt = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=User::class)
|
||||
*/
|
||||
#[Serializer\Groups(['read'])]
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
private ?User $createdBy = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
*/
|
||||
#[Serializer\Groups(['read', 'write', 'docgen:read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)]
|
||||
private ?string $email = null;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\GeneratedValue
|
||||
*
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
|
||||
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=LocationType::class)
|
||||
*
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
*/
|
||||
|
||||
#[Serializer\Groups(['read', 'write', 'docgen:read'])]
|
||||
#[ORM\ManyToOne(targetEntity: LocationType::class)]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?LocationType $locationType = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
*/
|
||||
#[Serializer\Groups(['read', 'write', 'docgen:read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)]
|
||||
private ?string $name = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="phone_number", nullable=true)
|
||||
*
|
||||
* @PhonenumberConstraint(type="any")
|
||||
*/
|
||||
#[Serializer\Groups(['read', 'write', 'docgen:read'])]
|
||||
#[ORM\Column(type: 'phone_number', nullable: true)]
|
||||
private ?PhoneNumber $phonenumber1 = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="phone_number", nullable=true)
|
||||
*
|
||||
* @PhonenumberConstraint(type="any")
|
||||
*/
|
||||
#[Serializer\Groups(['read', 'write', 'docgen:read'])]
|
||||
#[ORM\Column(type: 'phone_number', nullable: true)]
|
||||
private ?PhoneNumber $phonenumber2 = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable", nullable=true)
|
||||
*/
|
||||
#[Serializer\Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true)]
|
||||
private ?\DateTimeImmutable $updatedAt = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=User::class)
|
||||
*/
|
||||
#[Serializer\Groups(['read'])]
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
private ?User $updatedBy = null;
|
||||
|
||||
public function getActive(): ?bool
|
||||
|
@@ -17,13 +17,11 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
|
||||
|
||||
/**
|
||||
* @ORM\Table(name="chill_main_location_type")
|
||||
*
|
||||
* @ORM\Entity(repositoryClass=LocationTypeRepository::class)
|
||||
*/
|
||||
|
||||
#[DiscriminatorMap(typeProperty: 'type', mapping: ['location-type' => LocationType::class])]
|
||||
#[UniqueEntity(['defaultFor'])]
|
||||
#[ORM\Entity(repositoryClass: LocationTypeRepository::class)]
|
||||
#[ORM\Table(name: 'chill_main_location_type')]
|
||||
class LocationType
|
||||
{
|
||||
final public const DEFAULT_FOR_3PARTY = 'thirdparty';
|
||||
@@ -36,58 +34,42 @@ class LocationType
|
||||
|
||||
final public const STATUS_REQUIRED = 'required';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", nullable=true)
|
||||
*/
|
||||
#[Serializer\Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, nullable: true)]
|
||||
private bool $active = true;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=32, options={"default": "optional"})
|
||||
*/
|
||||
#[Serializer\Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 32, options: ['default' => 'optional'])]
|
||||
private string $addressRequired = self::STATUS_OPTIONAL;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
#[Serializer\Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
|
||||
private bool $availableForUsers = true;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=32, options={"default": "optional"})
|
||||
*/
|
||||
#[Serializer\Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 32, options: ['default' => 'optional'])]
|
||||
private string $contactData = self::STATUS_OPTIONAL;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", nullable=true, length=32, unique=true)
|
||||
*/
|
||||
#[Serializer\Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: true, length: 32, unique: true)]
|
||||
private ?string $defaultFor = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
#[Serializer\Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
|
||||
private bool $editableByUsers = true;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\GeneratedValue
|
||||
*
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
|
||||
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="json")
|
||||
*
|
||||
* @Serializer\Context({"is-translatable": true}, groups={"docgen:read"})
|
||||
*/
|
||||
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
|
||||
private array $title = [];
|
||||
|
||||
public function getActive(): ?bool
|
||||
|
@@ -19,55 +19,42 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation\Groups;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table(name="chill_main_news")
|
||||
*/
|
||||
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_main_news')]
|
||||
class NewsItem implements TrackCreationInterface, TrackUpdateInterface
|
||||
{
|
||||
use TrackCreationTrait;
|
||||
|
||||
use TrackUpdateTrait;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\GeneratedValue
|
||||
*
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
|
||||
#[Groups(['read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text")
|
||||
*/
|
||||
#[Groups(['read'])]
|
||||
#[Assert\NotBlank]
|
||||
#[Assert\NotNull]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT)]
|
||||
private string $title = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text")
|
||||
*/
|
||||
#[Groups(['read'])]
|
||||
#[Assert\NotBlank]
|
||||
#[Assert\NotNull]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT)]
|
||||
private string $content = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="date_immutable", nullable=false)
|
||||
*/
|
||||
#[Assert\NotNull]
|
||||
#[Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_IMMUTABLE, nullable: false)]
|
||||
private ?\DateTimeImmutable $startDate = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
|
||||
*/
|
||||
#[Assert\GreaterThanOrEqual(propertyPath: 'startDate')]
|
||||
#[Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_IMMUTABLE, nullable: true, options: ['default' => null])]
|
||||
private ?\DateTimeImmutable $endDate = null;
|
||||
|
||||
public function getTitle(): string
|
||||
|
@@ -18,24 +18,14 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table(
|
||||
* name="chill_main_notification",
|
||||
* indexes={
|
||||
*
|
||||
* @ORM\Index(name="chill_main_notification_related_entity_idx", columns={"relatedentityclass", "relatedentityid"})
|
||||
* }
|
||||
* )
|
||||
*
|
||||
* @ORM\HasLifecycleCallbacks
|
||||
*/
|
||||
|
||||
#[ORM\Entity]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
#[ORM\Table(name: 'chill_main_notification')]
|
||||
#[ORM\Index(name: 'chill_main_notification_related_entity_idx', columns: ['relatedentityclass', 'relatedentityid'])]
|
||||
class Notification implements TrackUpdateInterface
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=false)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false)]
|
||||
private string $accessKey;
|
||||
|
||||
private array $addedAddresses = [];
|
||||
@@ -43,19 +33,18 @@ class Notification implements TrackUpdateInterface
|
||||
/**
|
||||
* @var Collection<User>
|
||||
*
|
||||
* @ORM\ManyToMany(targetEntity=User::class)
|
||||
*
|
||||
* @ORM\JoinTable(name="chill_main_notification_addresses_user")
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: User::class)]
|
||||
#[ORM\JoinTable(name: 'chill_main_notification_addresses_user')]
|
||||
private Collection $addressees;
|
||||
|
||||
/**
|
||||
* a list of destinee which will receive notifications.
|
||||
*
|
||||
* @var array|string[]
|
||||
*
|
||||
* @ORM\Column(type="json")
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
|
||||
private array $addressesEmails = [];
|
||||
|
||||
/**
|
||||
@@ -70,73 +59,54 @@ class Notification implements TrackUpdateInterface
|
||||
/**
|
||||
* @var Collection<NotificationComment>
|
||||
*
|
||||
* @ORM\OneToMany(targetEntity=NotificationComment::class, mappedBy="notification", orphanRemoval=true)
|
||||
*
|
||||
* @ORM\OrderBy({"createdAt": "ASC"})
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: NotificationComment::class, mappedBy: 'notification', orphanRemoval: true)]
|
||||
#[ORM\OrderBy(['createdAt' => \Doctrine\Common\Collections\Criteria::ASC])]
|
||||
private Collection $comments;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable")
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE)]
|
||||
private \DateTimeImmutable $date;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\GeneratedValue
|
||||
*
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text")
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT)]
|
||||
private string $message = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)]
|
||||
private string $relatedEntityClass = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
private int $relatedEntityId;
|
||||
|
||||
private array $removedAddresses = [];
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=User::class)
|
||||
*
|
||||
* @ORM\JoinColumn(nullable=true)
|
||||
*/
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
#[ORM\JoinColumn(nullable: true)]
|
||||
private ?User $sender = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", options={"default": ""})
|
||||
*/
|
||||
#[Assert\NotBlank(message: 'notification.Title must be defined')]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, options: ['default' => ''])]
|
||||
private string $title = '';
|
||||
|
||||
/**
|
||||
* @var Collection<User>
|
||||
*
|
||||
* @ORM\ManyToMany(targetEntity=User::class)
|
||||
*
|
||||
* @ORM\JoinTable(name="chill_main_notification_addresses_unread")
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: User::class)]
|
||||
#[ORM\JoinTable(name: 'chill_main_notification_addresses_unread')]
|
||||
private Collection $unreadBy;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable")
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE)]
|
||||
private ?\DateTimeImmutable $updatedAt = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=User::class)
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
private ?User $updatedBy = null;
|
||||
|
||||
public function __construct()
|
||||
@@ -312,9 +282,7 @@ class Notification implements TrackUpdateInterface
|
||||
return $this->addUnreadBy($user);
|
||||
}
|
||||
|
||||
/**
|
||||
* @ORM\PreFlush
|
||||
*/
|
||||
#[ORM\PreFlush]
|
||||
public function registerUnread()
|
||||
{
|
||||
foreach ($this->addedAddresses as $addressee) {
|
||||
|
@@ -18,47 +18,33 @@ use Doctrine\ORM\Event\PrePersistEventArgs;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table("chill_main_notification_comment")
|
||||
*
|
||||
* @ORM\HasLifecycleCallbacks
|
||||
*/
|
||||
|
||||
#[ORM\Entity]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
#[ORM\Table('chill_main_notification_comment')]
|
||||
class NotificationComment implements TrackCreationInterface, TrackUpdateInterface
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="text")
|
||||
*/
|
||||
#[Assert\NotBlank(message: 'notification.Comment content might not be blank')]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT)]
|
||||
private string $content = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true)]
|
||||
private ?\DateTimeImmutable $createdAt = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=User::class)
|
||||
*
|
||||
* @ORM\JoinColumn(nullable=true)
|
||||
*/
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
#[ORM\JoinColumn(nullable: true)]
|
||||
private ?User $createdBy = null;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\GeneratedValue
|
||||
*
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Notification::class, inversedBy="comments")
|
||||
*
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
*/
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: Notification::class, inversedBy: 'comments')]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?Notification $notification = null;
|
||||
|
||||
/**
|
||||
@@ -70,16 +56,13 @@ class NotificationComment implements TrackCreationInterface, TrackUpdateInterfac
|
||||
|
||||
/**
|
||||
* TODO typo in property (hotfixed).
|
||||
*
|
||||
* @ORM\Column(type="datetime_immutable", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true)]
|
||||
private ?\DateTimeImmutable $updateAt = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=User::class)
|
||||
*
|
||||
* @ORM\JoinColumn(nullable=true)
|
||||
*/
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
#[ORM\JoinColumn(nullable: true)]
|
||||
private ?User $updatedBy = null;
|
||||
|
||||
public function getContent(): string
|
||||
@@ -117,9 +100,7 @@ class NotificationComment implements TrackCreationInterface, TrackUpdateInterfac
|
||||
return $this->updatedBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* @ORM\PreFlush
|
||||
*/
|
||||
#[ORM\PreFlush]
|
||||
public function onFlushMarkNotificationAsUnread(PreFlushEventArgs $eventArgs): void
|
||||
{
|
||||
if ($this->recentlyPersisted) {
|
||||
@@ -135,9 +116,7 @@ class NotificationComment implements TrackCreationInterface, TrackUpdateInterfac
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @ORM\PrePersist
|
||||
*/
|
||||
#[ORM\PrePersist]
|
||||
public function onPrePersist(PrePersistEventArgs $eventArgs): void
|
||||
{
|
||||
$this->recentlyPersisted = true;
|
||||
|
@@ -16,56 +16,40 @@ use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table(name="permission_groups")
|
||||
*
|
||||
* @ORM\Cache(usage="NONSTRICT_READ_WRITE", region="acl_cache_region")
|
||||
*/
|
||||
|
||||
#[ORM\Entity]
|
||||
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE', region: 'acl_cache_region')]
|
||||
#[ORM\Table(name: 'permission_groups')]
|
||||
class PermissionsGroup
|
||||
{
|
||||
/**
|
||||
* @var string[]
|
||||
*
|
||||
* @ORM\Column(type="json")
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
|
||||
private array $flags = [];
|
||||
|
||||
/**
|
||||
* @var Collection<GroupCenter>
|
||||
*
|
||||
* @ORM\OneToMany(
|
||||
* targetEntity="Chill\MainBundle\Entity\GroupCenter",
|
||||
* mappedBy="permissionsGroup"
|
||||
* )
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: \Chill\MainBundle\Entity\GroupCenter::class, mappedBy: 'permissionsGroup')]
|
||||
private Collection $groupCenters;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
*
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255, nullable=false, options={"default": ""})
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: false, options: ['default' => ''])]
|
||||
private string $name = '';
|
||||
|
||||
/**
|
||||
* @var Collection<RoleScope>
|
||||
*
|
||||
* @ORM\ManyToMany(
|
||||
* targetEntity="Chill\MainBundle\Entity\RoleScope",
|
||||
* inversedBy="permissionsGroups",
|
||||
* cascade={ "persist" })
|
||||
*
|
||||
* @ORM\Cache(usage="NONSTRICT_READ_WRITE")
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: \Chill\MainBundle\Entity\RoleScope::class, inversedBy: 'permissionsGroups', cascade: ['persist'])]
|
||||
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE')]
|
||||
private Collection $roleScopes;
|
||||
|
||||
/**
|
||||
|
@@ -22,23 +22,23 @@ use Symfony\Component\Serializer\Annotation\Groups;
|
||||
/**
|
||||
* PostalCode.
|
||||
*
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table(
|
||||
* name="chill_main_postal_code",
|
||||
* uniqueConstraints={
|
||||
*
|
||||
* @ORM\UniqueConstraint(name="postal_code_import_unicity", columns={"code", "refpostalcodeid", "postalcodesource"},
|
||||
* options={"where": "refpostalcodeid is not null"})
|
||||
* },
|
||||
* indexes={
|
||||
*
|
||||
* @ORM\Index(name="search_name_code", columns={"code", "label"}),
|
||||
* @ORM\Index(name="search_by_reference_code", columns={"code", "refpostalcodeid"})
|
||||
* })
|
||||
*
|
||||
* @ORM\HasLifecycleCallbacks
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
#[ORM\Entity]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
#[ORM\Table(name: 'chill_main_postal_code')]
|
||||
#[ORM\Index(name: 'search_name_code', columns: ['code', 'label'])]
|
||||
#[ORM\Index(name: 'search_by_reference_code', columns: ['code', 'refpostalcodeid'])]
|
||||
#[ORM\UniqueConstraint(name: 'postal_code_import_unicity', columns: ['code', 'refpostalcodeid', 'postalcodesource'], options: ['where' => 'refpostalcodeid is not null'])]
|
||||
#[ORM\UniqueConstraint(name: 'postal_code_import_unicity', columns: ['code', 'refpostalcodeid', 'postalcodesource'], options: ['where' => 'refpostalcodeid is not null'])] // ,
|
||||
#[ORM\Index(name: 'search_name_code', columns: ['code', 'label'])] // ,
|
||||
#[ORM\Index(name: 'search_by_reference_code', columns: ['code', 'refpostalcodeid'])]
|
||||
class PostalCode implements TrackUpdateInterface, TrackCreationInterface
|
||||
{
|
||||
use TrackCreationTrait;
|
||||
@@ -49,66 +49,46 @@ class PostalCode implements TrackUpdateInterface, TrackCreationInterface
|
||||
* This is an internal column which is populated by database.
|
||||
*
|
||||
* This column will ease the search operations
|
||||
*
|
||||
* @ORM\Column(type="text", options={"default": ""})
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, options: ['default' => ''])]
|
||||
private string $canonical = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="point", nullable=true)
|
||||
*/
|
||||
#[Groups(['read'])]
|
||||
#[ORM\Column(type: 'point', nullable: true)]
|
||||
private ?Point $center = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=100)
|
||||
*/
|
||||
#[Groups(['write', 'read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 100)]
|
||||
private ?string $code = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Country")
|
||||
*/
|
||||
#[Groups(['write', 'read'])]
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Country::class)]
|
||||
private ?Country $country = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable", nullable=true, options={"default": null})
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true, options: ['default' => null])]
|
||||
private ?\DateTimeImmutable $deletedAt = null;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
*
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
|
||||
#[Groups(['write', 'read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255, name="label")
|
||||
*/
|
||||
#[Groups(['write', 'read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, name: 'label')]
|
||||
private ?string $name = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="origin", type="integer", nullable=true)
|
||||
*/
|
||||
#[Groups(['write', 'read'])]
|
||||
#[ORM\Column(name: 'origin', type: \Doctrine\DBAL\Types\Types::INTEGER, nullable: true)]
|
||||
private int $origin = 0;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
*/
|
||||
#[Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)]
|
||||
private ?string $postalCodeSource = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
*/
|
||||
#[Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)]
|
||||
private ?string $refPostalCodeId = null;
|
||||
|
||||
public function getCenter(): ?Point
|
||||
|
@@ -15,42 +15,30 @@ use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table(name="regroupment")
|
||||
*/
|
||||
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'regroupment')]
|
||||
class Regroupment
|
||||
{
|
||||
/**
|
||||
* @ORM\ManyToMany(
|
||||
* targetEntity=Center::class,
|
||||
* inversedBy="regroupments"
|
||||
* )
|
||||
*
|
||||
* @ORM\Id
|
||||
*
|
||||
* @var Collection<Center>
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: Center::class, inversedBy: 'regroupments')]
|
||||
#[ORM\Id]
|
||||
private Collection $centers;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\GeneratedValue
|
||||
*
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
|
||||
private bool $isActive = true;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", options={"default": ""}, nullable=false)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, options: ['default' => ''], nullable: false)]
|
||||
private string $name = '';
|
||||
|
||||
public function __construct()
|
||||
|
@@ -15,47 +15,31 @@ use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table(name="role_scopes")
|
||||
*
|
||||
* @ORM\Cache(usage="NONSTRICT_READ_WRITE", region="acl_cache_region")
|
||||
*/
|
||||
|
||||
#[ORM\Entity]
|
||||
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE', region: 'acl_cache_region')]
|
||||
#[ORM\Table(name: 'role_scopes')]
|
||||
class RoleScope
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
*
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @var Collection<PermissionsGroup>
|
||||
*
|
||||
* @ORM\ManyToMany(
|
||||
* targetEntity="Chill\MainBundle\Entity\PermissionsGroup",
|
||||
* mappedBy="roleScopes")
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: \Chill\MainBundle\Entity\PermissionsGroup::class, mappedBy: 'roleScopes')]
|
||||
private Collection $permissionsGroups;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)]
|
||||
private ?string $role = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="Chill\MainBundle\Entity\Scope",
|
||||
* inversedBy="roleScopes")
|
||||
*
|
||||
* @ORM\JoinColumn(nullable=true, name="scope_id")
|
||||
*
|
||||
* @ORM\Cache(usage="NONSTRICT_READ_WRITE")
|
||||
*/
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Scope::class, inversedBy: 'roleScopes')]
|
||||
#[ORM\JoinColumn(nullable: true, name: 'scope_id')]
|
||||
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE')]
|
||||
private ?Scope $scope = null;
|
||||
|
||||
public function __construct()
|
||||
|
@@ -20,51 +20,36 @@ use Ramsey\Uuid\Uuid;
|
||||
use Ramsey\Uuid\UuidInterface;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table(name="chill_main_saved_export")
|
||||
*/
|
||||
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_main_saved_export')]
|
||||
class SavedExport implements TrackCreationInterface, TrackUpdateInterface
|
||||
{
|
||||
use TrackCreationTrait;
|
||||
|
||||
use TrackUpdateTrait;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=false, options={"default": ""})
|
||||
*/
|
||||
#[Assert\NotBlank]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
|
||||
private string $description = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=false, options={"default": ""})
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
|
||||
private string $exportAlias;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\Column(name="id", type="uuid", unique="true")
|
||||
*
|
||||
* @ORM\GeneratedValue(strategy="NONE")
|
||||
*/
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(name: 'id', type: 'uuid', unique: 'true')]
|
||||
#[ORM\GeneratedValue(strategy: 'NONE')]
|
||||
private UuidInterface $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="json", nullable=false, options={"default": "[]"})
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, nullable: false, options: ['default' => '[]'])]
|
||||
private array $options = [];
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=false, options={"default": ""})
|
||||
*/
|
||||
#[Assert\NotBlank]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
|
||||
private string $title = '';
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=User::class)
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
private User $user;
|
||||
|
||||
public function __construct()
|
||||
|
@@ -18,50 +18,40 @@ use Symfony\Component\Serializer\Annotation\Context;
|
||||
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
|
||||
use Symfony\Component\Serializer\Annotation\Groups;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table(name="scopes")
|
||||
*
|
||||
* @ORM\Cache(usage="NONSTRICT_READ_WRITE", region="acl_cache_region")
|
||||
*/
|
||||
|
||||
#[DiscriminatorMap(typeProperty: 'type', mapping: ['scope' => Scope::class])]
|
||||
#[ORM\Entity]
|
||||
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE', region: 'acl_cache_region')]
|
||||
#[ORM\Table(name: 'scopes')]
|
||||
class Scope
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="boolean", nullable=false, options={"default": true})
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, nullable: false, options: ['default' => true])]
|
||||
private bool $active = true;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
*
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* translatable names.
|
||||
*
|
||||
* @ORM\Column(type="json")
|
||||
*
|
||||
* @Context({"is-translatable": true}, groups={"docgen:read"})
|
||||
*/
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
|
||||
private array $name = [];
|
||||
|
||||
/**
|
||||
* @var Collection<RoleScope>
|
||||
*
|
||||
* @ORM\OneToMany(
|
||||
* targetEntity="Chill\MainBundle\Entity\RoleScope",
|
||||
* mappedBy="scope")
|
||||
*
|
||||
* @ORM\Cache(usage="NONSTRICT_READ_WRITE")
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: \Chill\MainBundle\Entity\RoleScope::class, mappedBy: 'scope')]
|
||||
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE')]
|
||||
private Collection $roleScopes;
|
||||
|
||||
/**
|
||||
|
@@ -28,146 +28,100 @@ use Chill\MainBundle\Validation\Constraint\PhonenumberConstraint;
|
||||
/**
|
||||
* User.
|
||||
*
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table(name="users")
|
||||
*
|
||||
* @ORM\Cache(usage="NONSTRICT_READ_WRITE", region="acl_cache_region")
|
||||
*/
|
||||
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['user' => User::class])]
|
||||
#[ORM\Entity]
|
||||
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE', region: 'acl_cache_region')]
|
||||
#[ORM\Table(name: 'users')]
|
||||
class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInterface
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
*
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||
protected ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true)]
|
||||
private ?\DateTimeImmutable $absenceStart = null;
|
||||
|
||||
/**
|
||||
* Array where SAML attributes's data are stored.
|
||||
*
|
||||
* @ORM\Column(type="json", nullable=false)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, nullable: false)]
|
||||
private array $attributes = [];
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Civility::class)
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: Civility::class)]
|
||||
private ?Civility $civility = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Location::class)
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: Location::class)]
|
||||
private ?Location $currentLocation = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=150, nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 150, nullable: true)]
|
||||
private ?string $email = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(
|
||||
* type="string",
|
||||
* length=150,
|
||||
* nullable=true,
|
||||
* unique=true)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 150, nullable: true, unique: true)]
|
||||
private ?string $emailCanonical = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
|
||||
private bool $enabled = true;
|
||||
|
||||
/**
|
||||
* @var Collection<GroupCenter>
|
||||
*
|
||||
* @ORM\ManyToMany(
|
||||
* targetEntity="Chill\MainBundle\Entity\GroupCenter",
|
||||
* inversedBy="users")
|
||||
*
|
||||
* @ORM\Cache(usage="NONSTRICT_READ_WRITE")
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: \Chill\MainBundle\Entity\GroupCenter::class, inversedBy: 'users')]
|
||||
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE')]
|
||||
private Collection $groupCenters;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=200)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 200)]
|
||||
private string $label = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
* sf4 check: in yml was false by default !?
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)] // sf4 check: in yml was false by default !?
|
||||
private bool $locked = true;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Center::class)
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: Center::class)]
|
||||
private ?Center $mainCenter = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Location::class)
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: Location::class)]
|
||||
private ?Location $mainLocation = null;
|
||||
|
||||
/**
|
||||
* @var Collection&Selectable<int, UserScopeHistory>
|
||||
*
|
||||
* @ORM\OneToMany(targetEntity=UserScopeHistory::class,
|
||||
* mappedBy="user", cascade={"persist", "remove"}, orphanRemoval=true)
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: UserScopeHistory::class, mappedBy: 'user', cascade: ['persist', 'remove'], orphanRemoval: true)]
|
||||
private Collection&Selectable $scopeHistories;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)]
|
||||
private string $password = '';
|
||||
|
||||
/**
|
||||
* @internal must be set to null if we use bcrypt
|
||||
*
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)]
|
||||
private ?string $salt = null;
|
||||
|
||||
/**
|
||||
* @var Collection&Selectable<int, UserJobHistory>
|
||||
*
|
||||
* @ORM\OneToMany(targetEntity=UserJobHistory::class,
|
||||
* mappedBy="user", cascade={"persist", "remove"}, orphanRemoval=true)
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: UserJobHistory::class, mappedBy: 'user', cascade: ['persist', 'remove'], orphanRemoval: true)]
|
||||
private Collection&Selectable $jobHistories;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=80)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 80)]
|
||||
private string $username = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(
|
||||
* type="string",
|
||||
* length=80,
|
||||
* unique=true,
|
||||
* nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 80, unique: true, nullable: true)]
|
||||
private ?string $usernameCanonical = null;
|
||||
|
||||
/**
|
||||
* The user's mobile phone number.
|
||||
*
|
||||
* @ORM\Column(type="phone_number", nullable=true)
|
||||
*
|
||||
* @PhonenumberConstraint()
|
||||
*/
|
||||
#[ORM\Column(type: 'phone_number', nullable: true)]
|
||||
private ?PhoneNumber $phonenumber = null;
|
||||
|
||||
/**
|
||||
|
@@ -16,40 +16,27 @@ use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Entity\UserJob;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Table(name="chill_main_user_job_history")
|
||||
*
|
||||
* @ORM\Entity(repositoryClass=UserJobHistoryRepository::class)
|
||||
*/
|
||||
|
||||
#[ORM\Entity(repositoryClass: UserJobHistoryRepository::class)]
|
||||
#[ORM\Table(name: 'chill_main_user_job_history')]
|
||||
class UserJobHistory
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true)]
|
||||
private ?\DateTimeImmutable $endDate = null;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\GeneratedValue
|
||||
*
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=UserJob::class)
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: UserJob::class)]
|
||||
private ?UserJob $job = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable")
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE)]
|
||||
private \DateTimeImmutable $startDate;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=User::class)
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
private User $user;
|
||||
|
||||
public function getEndDate(): ?\DateTimeImmutable
|
||||
|
@@ -16,40 +16,27 @@ use Chill\MainBundle\Entity\Scope;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Table(name="chill_main_user_scope_history")
|
||||
*
|
||||
* @ORM\Entity(repositoryClass=UserScopeHistoryRepository::class)
|
||||
*/
|
||||
|
||||
#[ORM\Entity(repositoryClass: UserScopeHistoryRepository::class)]
|
||||
#[ORM\Table(name: 'chill_main_user_scope_history')]
|
||||
class UserScopeHistory
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true)]
|
||||
private ?\DateTimeImmutable $endDate = null;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\GeneratedValue
|
||||
*
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Scope::class)
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: Scope::class)]
|
||||
private ?Scope $scope = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable")
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE)]
|
||||
private \DateTimeImmutable $startDate;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=User::class)
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
private User $user;
|
||||
|
||||
public function getEndDate(): ?\DateTimeImmutable
|
||||
|
@@ -14,37 +14,30 @@ namespace Chill\MainBundle\Entity;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table("chill_main_user_job")
|
||||
*/
|
||||
|
||||
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['user_job' => UserJob::class])]
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table('chill_main_user_job')]
|
||||
class UserJob
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(name="active", type="boolean")
|
||||
*/
|
||||
#[ORM\Column(name: 'active', type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
|
||||
protected bool $active = true;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
*
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
|
||||
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||
protected ?int $id = null;
|
||||
|
||||
/**
|
||||
* @var array<string, string>
|
||||
*
|
||||
* @ORM\Column(name="label", type="json")
|
||||
*
|
||||
* @Serializer\Context({"is-translatable": true}, groups={"docgen:read"})
|
||||
*/
|
||||
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||
#[ORM\Column(name: 'label', type: \Doctrine\DBAL\Types\Types::JSON)]
|
||||
protected array $label = [];
|
||||
|
||||
public function getId(): ?int
|
||||
|
@@ -24,13 +24,13 @@ use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table("chill_main_workflow_entity")
|
||||
*
|
||||
* @EntityWorkflowCreation(groups={"creation"})
|
||||
*/
|
||||
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['entity_workflow' => EntityWorkflow::class])]
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table('chill_main_workflow_entity')]
|
||||
class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
|
||||
{
|
||||
use TrackCreationTrait;
|
||||
@@ -67,39 +67,31 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
|
||||
public array $futureDestUsers = [];
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity=EntityWorkflowComment::class, mappedBy="entityWorkflow", orphanRemoval=true)
|
||||
*
|
||||
* @var Collection<EntityWorkflowComment>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: EntityWorkflowComment::class, mappedBy: 'entityWorkflow', orphanRemoval: true)]
|
||||
private Collection $comments;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\GeneratedValue
|
||||
*
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)]
|
||||
private string $relatedEntityClass = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
private int $relatedEntityId;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity=EntityWorkflowStep::class, mappedBy="entityWorkflow", orphanRemoval=true, cascade={"persist"})
|
||||
*
|
||||
* @ORM\OrderBy({"transitionAt": "ASC", "id": "ASC"})
|
||||
*
|
||||
* @var Collection<EntityWorkflowStep>
|
||||
*/
|
||||
#[Assert\Valid(traverse: true)]
|
||||
#[ORM\OneToMany(targetEntity: EntityWorkflowStep::class, mappedBy: 'entityWorkflow', orphanRemoval: true, cascade: ['persist'])]
|
||||
#[ORM\OrderBy(['transitionAt' => \Doctrine\Common\Collections\Criteria::ASC, 'id' => 'ASC'])]
|
||||
private Collection $steps;
|
||||
|
||||
/**
|
||||
@@ -108,21 +100,21 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
|
||||
private ?array $stepsChainedCache = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity=User::class)
|
||||
*
|
||||
* @ORM\JoinTable(name="chill_main_workflow_entity_subscriber_to_final")
|
||||
*
|
||||
* @var Collection<User>
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: User::class)]
|
||||
#[ORM\JoinTable(name: 'chill_main_workflow_entity_subscriber_to_final')]
|
||||
private Collection $subscriberToFinal;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity=User::class)
|
||||
*
|
||||
* @ORM\JoinTable(name="chill_main_workflow_entity_subscriber_to_step")
|
||||
*
|
||||
* @var Collection<User>
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: User::class)]
|
||||
#[ORM\JoinTable(name: 'chill_main_workflow_entity_subscriber_to_step')]
|
||||
private Collection $subscriberToStep;
|
||||
|
||||
/**
|
||||
@@ -130,9 +122,7 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
|
||||
*/
|
||||
private ?EntityWorkflowStep $transitionningStep = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text")
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT)]
|
||||
private string $workflowName;
|
||||
|
||||
public function __construct()
|
||||
|
@@ -17,34 +17,25 @@ use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
|
||||
use Chill\MainBundle\Doctrine\Model\TrackUpdateTrait;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table("chill_main_workflow_entity_comment")
|
||||
*/
|
||||
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table('chill_main_workflow_entity_comment')]
|
||||
class EntityWorkflowComment implements TrackCreationInterface, TrackUpdateInterface
|
||||
{
|
||||
use TrackCreationTrait;
|
||||
|
||||
use TrackUpdateTrait;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", options={"default": ""})
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, options: ['default' => ''])]
|
||||
private string $comment = '';
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=EntityWorkflow::class, inversedBy="comments")
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: EntityWorkflow::class, inversedBy: 'comments')]
|
||||
private ?EntityWorkflow $entityWorkflow = null;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\GeneratedValue
|
||||
*
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
private ?int $id = null;
|
||||
|
||||
public function getComment(): string
|
||||
|
@@ -18,82 +18,63 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table("chill_main_workflow_entity_step")
|
||||
*/
|
||||
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table('chill_main_workflow_entity_step')]
|
||||
class EntityWorkflowStep
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=false)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false)]
|
||||
private string $accessKey;
|
||||
|
||||
/**
|
||||
* @var Collection<User>
|
||||
*
|
||||
* @ORM\ManyToMany(targetEntity=User::class)
|
||||
*
|
||||
* @ORM\JoinTable(name="chill_main_workflow_entity_step_cc_user")
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: User::class)]
|
||||
#[ORM\JoinTable(name: 'chill_main_workflow_entity_step_cc_user')]
|
||||
private Collection $ccUser;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", options={"default": ""})
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, options: ['default' => ''])]
|
||||
private string $comment = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text")
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT)]
|
||||
private ?string $currentStep = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="json")
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
|
||||
private array $destEmail = [];
|
||||
|
||||
/**
|
||||
* @var Collection<User>
|
||||
*
|
||||
* @ORM\ManyToMany(targetEntity=User::class)
|
||||
*
|
||||
* @ORM\JoinTable(name="chill_main_workflow_entity_step_user")
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: User::class)]
|
||||
#[ORM\JoinTable(name: 'chill_main_workflow_entity_step_user')]
|
||||
private Collection $destUser;
|
||||
|
||||
/**
|
||||
* @var Collection<User>
|
||||
*
|
||||
* @ORM\ManyToMany(targetEntity=User::class)
|
||||
*
|
||||
* @ORM\JoinTable(name="chill_main_workflow_entity_step_user_by_accesskey")
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: User::class)]
|
||||
#[ORM\JoinTable(name: 'chill_main_workflow_entity_step_user_by_accesskey')]
|
||||
private Collection $destUserByAccessKey;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=EntityWorkflow::class, inversedBy="steps")
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: EntityWorkflow::class, inversedBy: 'steps')]
|
||||
private ?EntityWorkflow $entityWorkflow = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", options={"default": false})
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, options: ['default' => false])]
|
||||
private bool $freezeAfter = false;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\GeneratedValue
|
||||
*
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", options={"default": false})
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, options: ['default' => false])]
|
||||
private bool $isFinal = false;
|
||||
|
||||
/**
|
||||
@@ -106,26 +87,18 @@ class EntityWorkflowStep
|
||||
*/
|
||||
private ?EntityWorkflowStep $previous = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true, options={"default": null})
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: true, options: ['default' => null])]
|
||||
private ?string $transitionAfter = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable", nullable=true, options={"default": null})
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true, options: ['default' => null])]
|
||||
private ?\DateTimeImmutable $transitionAt = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=User::class)
|
||||
*
|
||||
* @ORM\JoinColumn(nullable=true)
|
||||
*/
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
||||
#[ORM\JoinColumn(nullable: true)]
|
||||
private ?User $transitionBy = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: true)]
|
||||
private ?string $transitionByEmail = null;
|
||||
|
||||
public function __construct()
|
||||
|
Reference in New Issue
Block a user