mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
Apply rector rules: add annotation for doctrine mapping
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user