Browse Source

Php8 passage d'annotation à attribut

feature/symfony6.1
Fabien Normand 1 year ago
parent
commit
d3feaac3f0
10 changed files with 59 additions and 97 deletions
  1. +1
    -1
      config/packages/doctrine.yaml
  2. +5
    -9
      src/Entity/File/File.php
  3. +6
    -9
      src/Entity/Reminder/Reminder.php
  4. +5
    -9
      src/Entity/Setting/SiteSetting.php
  5. +9
    -19
      src/Entity/Site/Page.php
  6. +9
    -13
      src/Entity/Site/Site.php
  7. +6
    -9
      src/Entity/Ticket/Ticket.php
  8. +6
    -9
      src/Entity/Ticket/TicketMessage.php
  9. +6
    -9
      src/Entity/User/GroupUser.php
  10. +6
    -10
      src/Entity/User/User.php

+ 1
- 1
config/packages/doctrine.yaml View File

@@ -9,7 +9,7 @@ doctrine:
mappings:
App:
is_bundle: false
type: annotation
type: attribute
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App

+ 5
- 9
src/Entity/File/File.php View File

@@ -7,17 +7,13 @@ use Lc\SovBundle\Model\File\FileInterface;
use Lc\SovBundle\Model\File\FileModel;
use Lc\SovBundle\Repository\File\FileRepository;

/**
* @ORM\Entity(repositoryClass=FileRepository::class)
*/
#[ORM\Entity(repositoryClass: FileRepository::class)]
class File extends FileModel implements FileInterface
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;

public function getId(): ?int
{

+ 6
- 9
src/Entity/Reminder/Reminder.php View File

@@ -5,18 +5,15 @@ namespace App\Entity\Reminder;

use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\Reminder\ReminderModel;
use Lc\SovBundle\Repository\Reminder\ReminderRepository;

/**
* @ORM\Entity(repositoryClass=ReminderRepository::class)
*/
#[ORM\Entity(repositoryClass: ReminderRepository::class)]
class Reminder extends ReminderModel
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private ?int $id = null;

public function getId(): ?int
{

+ 5
- 9
src/Entity/Setting/SiteSetting.php View File

@@ -6,17 +6,13 @@ use Lc\SovBundle\Repository\Setting\SiteSettingRepository;
use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\Setting\SiteSettingModel;

/**
* @ORM\Entity(repositoryClass=SiteSettingRepository::class)
*/
#[ORM\Entity(repositoryClass: SiteSettingRepository::class)]
class SiteSetting extends SiteSettingModel
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private ?int $id = null;

public function getId(): ?int
{

+ 9
- 19
src/Entity/Site/Page.php View File

@@ -9,32 +9,22 @@ use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity;
use App\Entity\File\File;
use Lc\SovBundle\Repository\Site\PageRepository;

/**
* @ORM\Entity(repositoryClass=PageRepository::class)
*/
#[ORM\Entity(repositoryClass: PageRepository::class)]
class Page extends AbstractFullEntity
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private ?int $id = null;

/**
* @ORM\ManyToOne(targetEntity=File::class, cascade={"persist", "remove"})
*/
#[ORM\ManyToOne(targetEntity: File::class, cascade: ['persist', 'remove'])]
private $image;

/**
* @ORM\ManyToMany(targetEntity=File::class, cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"position" = "ASC"})
*/
#[ORM\ManyToMany(targetEntity: File::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
#[ORM\OrderBy(['position' => 'ASC'])]
private $gallery;

/**
* @ORM\ManyToOne(targetEntity=File::class, cascade={"persist"})
*/
#[ORM\ManyToOne(targetEntity: File::class, cascade: ['persist'])]
private $file;

public function __construct()

+ 9
- 13
src/Entity/Site/Site.php View File

@@ -6,20 +6,16 @@ use Lc\SovBundle\Repository\Site\SiteRepository;
use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\Site\SiteModel;

/**
* @ORM\Entity(repositoryClass=SiteRepository::class)
*/
#[ORM\Entity(repositoryClass: SiteRepository::class)]
class Site extends SiteModel
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private ?int $id = null;

public function getId(): ?int
{
return $this->id;
}
public function getId(): ?int
{
return $this->id;
}
}

+ 6
- 9
src/Entity/Ticket/Ticket.php View File

@@ -5,18 +5,15 @@ namespace App\Entity\Ticket;

use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\Ticket\TicketModel;
use Lc\SovBundle\Repository\Ticket\TicketRepository;

/**
* @ORM\Entity(repositoryClass=TicketRepository::class)
*/
#[ORM\Entity(repositoryClass: TicketRepository::class)]
class Ticket extends TicketModel
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private ?int $id = null;

public function getId(): ?int
{

+ 6
- 9
src/Entity/Ticket/TicketMessage.php View File

@@ -5,18 +5,15 @@ namespace App\Entity\Ticket;

use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\Ticket\TicketMessageModel;
use Lc\SovBundle\Repository\Ticket\TicketMessageRepository;

/**
* @ORM\Entity(repositoryClass=TicketMessageRepository::class)
*/
#[ORM\Entity(repositoryClass: TicketMessageRepository::class)]
class TicketMessage extends TicketMessageModel
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private ?int $id = null;

public function getId(): ?int
{

+ 6
- 9
src/Entity/User/GroupUser.php View File

@@ -5,18 +5,15 @@ namespace App\Entity\User;

use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\User\GroupUserModel;
use Lc\SovBundle\Repository\User\GroupUserRepository;

/**
* @ORM\Entity(repositoryClass=GroupUserRepository::class)
*/
#[ORM\Entity(repositoryClass: GroupUserRepository::class)]
class GroupUser extends GroupUserModel
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private ?int $id = null;

public function getId(): ?int
{

+ 6
- 10
src/Entity/User/User.php View File

@@ -7,18 +7,14 @@ use Lc\SovBundle\Model\User\UserModel as SovUserModel;
use Lc\SovBundle\Model\User\UserInterface;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;

/**
* @ORM\Entity(repositoryClass="Lc\SovBundle\Repository\User\UserRepository")
* @UniqueEntity(fields={"email"}, message="There is already an account with this email")
*/
#[ORM\Entity(repositoryClass: 'Lc\SovBundle\Repository\User\UserRepository')]
#[UniqueEntity(fields: ['email'], message: 'There is already an account with this email')]
class User extends SovUserModel implements UserInterface
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private ?int $id = null;


public function getId(): ?int

Loading…
Cancel
Save