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

mappings: mappings:
App: App:
is_bundle: false is_bundle: false
type: annotation
type: attribute
dir: '%kernel.project_dir%/src/Entity' dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity' prefix: 'App\Entity'
alias: App alias: App

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

use Lc\SovBundle\Model\File\FileModel; use Lc\SovBundle\Model\File\FileModel;
use Lc\SovBundle\Repository\File\FileRepository; use Lc\SovBundle\Repository\File\FileRepository;


/**
* @ORM\Entity(repositoryClass=FileRepository::class)
*/
#[ORM\Entity(repositoryClass: FileRepository::class)]
class File extends FileModel implements FileInterface 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 public function getId(): ?int
{ {

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



use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\Reminder\ReminderModel; 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 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 public function getId(): ?int
{ {

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

use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\Setting\SiteSettingModel; use Lc\SovBundle\Model\Setting\SiteSettingModel;


/**
* @ORM\Entity(repositoryClass=SiteSettingRepository::class)
*/
#[ORM\Entity(repositoryClass: SiteSettingRepository::class)]
class SiteSetting extends SiteSettingModel 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 public function getId(): ?int
{ {

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

use App\Entity\File\File; use App\Entity\File\File;
use Lc\SovBundle\Repository\Site\PageRepository; use Lc\SovBundle\Repository\Site\PageRepository;


/**
* @ORM\Entity(repositoryClass=PageRepository::class)
*/
#[ORM\Entity(repositoryClass: PageRepository::class)]
class Page extends AbstractFullEntity 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; 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; private $gallery;


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


public function __construct() public function __construct()

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

use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\Site\SiteModel; use Lc\SovBundle\Model\Site\SiteModel;


/**
* @ORM\Entity(repositoryClass=SiteRepository::class)
*/
#[ORM\Entity(repositoryClass: SiteRepository::class)]
class Site extends SiteModel 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



use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\Ticket\TicketModel; 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 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 public function getId(): ?int
{ {

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



use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\Ticket\TicketMessageModel; 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 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 public function getId(): ?int
{ {

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



use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\User\GroupUserModel; 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 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 public function getId(): ?int
{ {

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

use Lc\SovBundle\Model\User\UserInterface; use Lc\SovBundle\Model\User\UserInterface;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; 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 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 public function getId(): ?int

Loading…
Cancel
Save