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

@@ -15,17 +15,13 @@ use Chill\DocStoreBundle\Entity\StoredObject;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
/**
* @ORM\Entity
*
* @ORM\Table(name="chill_docgen_template")
*/
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['docgen_template' => DocGeneratorTemplate::class])]
#[ORM\Entity]
#[ORM\Table(name: 'chill_docgen_template')]
class DocGeneratorTemplate
{
/**
* @ORM\Column(type="boolean", options={"default": true})
*/
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, options: ['default' => true])]
private bool $active = true;
/**
@@ -33,50 +29,38 @@ class DocGeneratorTemplate
*
* so if $context = ''
* this template will use '' as context
*
* @ORM\Column(type="string", length=255)
*/
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)]
private string $context;
/**
* @ORM\Column(type="text", nullable=true)
*/
#[Serializer\Groups(['read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: true)]
private ?string $description = null;
/**
* Class name of the entity for which this template can be used.
*
* @ORM\Column(type="string", options={"default": ""})
*/
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, options: ['default' => ''])]
private string $entity = '';
/**
* @ORM\ManyToOne(targetEntity=StoredObject::class, cascade={"persist"}))
*/
#[ORM\ManyToOne(targetEntity: StoredObject::class, cascade: ['persist'])]
private ?StoredObject $file = null;
/**
* @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")
*/
#[Serializer\Groups(['read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
private array $name = [];
/**
* Options for the template.
*
* @ORM\Column(type="json", name="template_options", options={"default":"[]"})
*/
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, name: 'template_options', options: ['default' => '[]'])]
private array $options = [];
public function getContext(): ?string