Apply rector rules: add annotation for doctrine mapping

This commit is contained in:
2024-04-05 00:01:30 +02:00
parent 579bd829f8
commit 72016e1a21
124 changed files with 1724 additions and 3770 deletions

View File

@@ -19,60 +19,38 @@ use Chill\MainBundle\Doctrine\Model\TrackUpdateTrait;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\MappedSuperclass
*/
#[ORM\MappedSuperclass]
class Document implements TrackCreationInterface, TrackUpdateInterface
{
use TrackCreationTrait;
use TrackUpdateTrait;
/**
* @ORM\ManyToOne(targetEntity="Chill\DocStoreBundle\Entity\DocumentCategory")
*
* @ORM\JoinColumns({
*
* @ORM\JoinColumn(name="category_bundle_id", referencedColumnName="bundle_id"),
* @ORM\JoinColumn(name="category_id_inside_bundle", referencedColumnName="id_inside_bundle")
* })
*/
#[ORM\ManyToOne(targetEntity: \Chill\DocStoreBundle\Entity\DocumentCategory::class)]
#[ORM\JoinColumn(name: 'category_bundle_id', referencedColumnName: 'bundle_id')]
#[ORM\JoinColumn(name: 'category_id_inside_bundle', referencedColumnName: 'id_inside_bundle')]
private ?DocumentCategory $category = null;
/**
* @ORM\Column(type="datetime")
*/
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_MUTABLE)]
private ?\DateTimeInterface $date = null;
/**
* @ORM\Column(type="text")
*/
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT)]
private string $description = '';
/**
* @ORM\ManyToOne(
* targetEntity="Chill\DocStoreBundle\Entity\StoredObject",
* cascade={"persist"}
* )
*/
#[Assert\Valid]
#[Assert\NotNull(message: 'Upload a document')]
#[ORM\ManyToOne(targetEntity: \Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
private ?StoredObject $object = null;
/**
* @ORM\ManyToOne(targetEntity="Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate")
*/
#[ORM\ManyToOne(targetEntity: \Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate::class)]
private ?DocGeneratorTemplate $template = null;
/**
* @ORM\Column(type="text")
*/
#[Assert\Length(min: 2, max: 250)]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT)]
private string $title = '';
/**
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User")
*/
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\User::class)]
private ?\Chill\MainBundle\Entity\User $user = null;
public function getCategory(): ?DocumentCategory