Migrate to Doctrine attributes

This commit is contained in:
Yassine Guedidi
2025-04-05 12:55:51 +02:00
parent 0d93add058
commit 41767e8fbc
16 changed files with 201 additions and 334 deletions

View File

@ -8,50 +8,45 @@ use Gedmo\Mapping\Annotation as Gedmo;
use JMS\Serializer\Annotation\ExclusionPolicy;
use JMS\Serializer\Annotation\Expose;
use JMS\Serializer\Annotation\XmlRoot;
use Wallabag\Repository\TagRepository;
/**
* Tag.
*
* @XmlRoot("tag")
* @ORM\Table(
* name="`tag`",
* indexes={
* @ORM\Index(columns={"label"}),
* }
* )
* @ORM\Entity(repositoryClass="Wallabag\Repository\TagRepository")
* @ExclusionPolicy("all")
*/
#[ORM\Table(name: '`tag`')]
#[ORM\Index(columns: ['label'])]
#[ORM\Entity(repositoryClass: TagRepository::class)]
class Tag
{
/**
* @var int
*
* @Expose
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private $id;
/**
* @var string
*
* @Expose
* @ORM\Column(name="label", type="text")
*/
#[ORM\Column(name: 'label', type: 'text')]
private $label;
/**
* @Expose
* @Gedmo\Slug(fields={"label"}, prefix="t:")
* @ORM\Column(length=128, unique=true)
*/
#[ORM\Column(length: 128, unique: true)]
private $slug;
/**
* @ORM\ManyToMany(targetEntity="Entry", mappedBy="tags", cascade={"persist"})
*/
#[ORM\ManyToMany(targetEntity: Entry::class, mappedBy: 'tags', cascade: ['persist'])]
private $entries;
public function __construct()