Просмотр исходного кода

Php8 passage d'annotation à attribut

feature/symfony6.1
Fabien Normand 1 год назад
Родитель
Сommit
4ac2f3a437
31 измененных файлов: 148 добавлений и 313 удалений
  1. +1
    -3
      Controller/Dashboard/CommandAdminController.php
  2. +1
    -3
      Controller/Dashboard/DashboardAdminController.php
  3. +4
    -12
      Controller/Reminder/ReminderAdminController.php
  4. +2
    -6
      Controller/Security/SecurityAdminController.php
  5. +1
    -3
      Controller/Setting/SettingAdminController.php
  6. +2
    -6
      Controller/User/AccountAdminController.php
  7. +4
    -4
      Doctrine/Extension/BlameableTrait.php
  8. +1
    -3
      Doctrine/Extension/DevAliasTrait.php
  9. +1
    -3
      Doctrine/Extension/ImageTrait.php
  10. +3
    -9
      Doctrine/Extension/OpenGraphTrait.php
  11. +3
    -7
      Doctrine/Extension/SeoTrait.php
  12. +1
    -1
      Doctrine/Extension/SluggableTrait.php
  13. +1
    -1
      Doctrine/Extension/SortableTrait.php
  14. +1
    -3
      Doctrine/Extension/StatusTrait.php
  15. +2
    -2
      Doctrine/Extension/TimestampableTrait.php
  16. +1
    -3
      Doctrine/Extension/TranslatableTrait.php
  17. +3
    -5
      Doctrine/Pattern/AbstractFullEntity.php
  18. +1
    -3
      Doctrine/Pattern/AbstractLightEntity.php
  19. +6
    -12
      Generator/CsvGenerator.php
  20. +47
    -49
      Model/File/FileModel.php
  21. +3
    -9
      Model/Newsletter/NewsletterModel.php
  22. +10
    -29
      Model/Reminder/ReminderModel.php
  23. +5
    -15
      Model/Setting/SettingModel.php
  24. +2
    -4
      Model/Setting/SiteSettingModel.php
  25. +6
    -16
      Model/Site/NewsModel.php
  26. +1
    -3
      Model/Site/PageModel.php
  27. +1
    -3
      Model/Site/SiteModel.php
  28. +6
    -16
      Model/Ticket/TicketMessageModel.php
  29. +12
    -34
      Model/Ticket/TicketModel.php
  30. +2
    -6
      Model/User/GroupUserModel.php
  31. +14
    -40
      Model/User/UserModel.php

+ 1
- 3
Controller/Dashboard/CommandAdminController.php Просмотреть файл

@@ -15,9 +15,7 @@ class CommandAdminController extends AbstractController
{
use ControllerTrait;

/**
* @Route("/admin/command/cache/clear", name="admin_command_cache_clear")
*/
#[Route(path: '/admin/command/cache/clear', name: 'admin_command_cache_clear')]
public function cacheClear(Request $request)
{
$this->doCommand('cache:clear');

+ 1
- 3
Controller/Dashboard/DashboardAdminController.php Просмотреть файл

@@ -19,9 +19,7 @@ class DashboardAdminController extends AbstractDashboardController

use ControllerTrait;

/**
* @Route("/admin", name="app_admin_dashboard")
*/
#[Route(path: '/admin', name: 'app_admin_dashboard')]
public function index(): Response
{
return $this->render('@LcSov/adminlte/dashboard.html.twig');

+ 4
- 12
Controller/Reminder/ReminderAdminController.php Просмотреть файл

@@ -40,9 +40,7 @@ class ReminderAdminController extends AbstractController
$this->parameterBag = $parameterBag;
}

/**
* @Route("/admin/reminder/modal", name="sov_admin_reminder_render_modal")
*/
#[Route(path: '/admin/reminder/modal', name: 'sov_admin_reminder_render_modal')]
public function renderModal(Request $request): Response
{
$id = $request->get('id');
@@ -80,9 +78,7 @@ class ReminderAdminController extends AbstractController
);
}

/**
* @Route("/admin/reminder/new", name="sov_admin_reminder_new")
*/
#[Route(path: '/admin/reminder/new', name: 'sov_admin_reminder_new')]
public function new(Request $request)
{
$reminder = $this->createEntity();
@@ -101,9 +97,7 @@ class ReminderAdminController extends AbstractController
return $this->redirect($request->headers->get('referer'));
}

/**
* @Route("/admin/reminder/edit/{id}", name="sov_admin_reminder_edit")
*/
#[Route(path: '/admin/reminder/edit/{id}', name: 'sov_admin_reminder_edit')]
public function edit(Request $request)
{
$id = $request->get('id');
@@ -123,9 +117,7 @@ class ReminderAdminController extends AbstractController
return $this->redirect($request->headers->get('referer'));
}

/**
* @Route("/admin/reminder/done", name="sov_admin_reminder_done")
*/
#[Route(path: '/admin/reminder/done', name: 'sov_admin_reminder_done')]
public function done(Request $request): JsonResponse
{
$id = $request->get('id');

+ 2
- 6
Controller/Security/SecurityAdminController.php Просмотреть файл

@@ -10,9 +10,7 @@ use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;

class SecurityAdminController extends AbstractController
{
/**
* @Route("/login", name="sov_login")
*/
#[Route(path: '/login', name: 'sov_login')]
public function login(AuthenticationUtils $authenticationUtils, Request $request): Response
{
if ($this->getUser()) {
@@ -66,9 +64,7 @@ class SecurityAdminController extends AbstractController
]);
}

/**
* @Route("/logout", name="sov_logout")
*/
#[Route(path: '/logout', name: 'sov_logout')]
public function logout()
{
throw new \LogicException(

+ 1
- 3
Controller/Setting/SettingAdminController.php Просмотреть файл

@@ -10,9 +10,7 @@ use Symfony\Component\Routing\Annotation\Route;

class SettingAdminController extends AbstractController
{
/**
* @Route("/admin/setting/site", name="sov_admin_setting_site")
*/
#[Route(path: '/admin/setting/site', name: 'sov_admin_setting_site')]
public function manageGlobal(Request $request)
{
$entityManager = $this->getEntityManager();

+ 2
- 6
Controller/User/AccountAdminController.php Просмотреть файл

@@ -24,9 +24,7 @@ class AccountAdminController extends AbstractController
$this->entityManager = $entityManager;
}

/**
* @Route("/admin/account/profile", name="sov_admin_account_profile")
*/
#[Route(path: '/admin/account/profile', name: 'sov_admin_account_profile')]
public function profile(Request $request): Response
{
$user = $this->getUser();
@@ -52,9 +50,7 @@ class AccountAdminController extends AbstractController
);
}

/**
* @Route("/admin/account/password", name="sov_admin_account_password")
*/
#[Route(path: '/admin/account/password', name: 'sov_admin_account_password')]
public function changePassword(Request $request, UserPasswordHasherInterface $passwordEncoder): Response
{
$user = $this->getUser();

+ 4
- 4
Doctrine/Extension/BlameableTrait.php Просмотреть файл

@@ -11,16 +11,16 @@ trait BlameableTrait

/**
* @Gedmo\Blameable(on="create")
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
*/
#[ORM\ManyToOne(targetEntity: 'Lc\SovBundle\Model\User\UserInterface')]
#[ORM\JoinColumn(nullable: true, onDelete: 'SET NULL')]
protected $createdBy;

/**
* @Gedmo\Blameable(on="update")
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
*/
#[ORM\ManyToOne(targetEntity: 'Lc\SovBundle\Model\User\UserInterface')]
#[ORM\JoinColumn(nullable: true, onDelete: 'SET NULL')]
protected $updatedBy;



+ 1
- 3
Doctrine/Extension/DevAliasTrait.php Просмотреть файл

@@ -7,9 +7,7 @@ use Doctrine\ORM\Mapping as ORM;
trait DevAliasTrait
{

/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
#[ORM\Column(type: 'string', length: 255, nullable: true)]
protected $devAlias;

public function getDevAlias(): ?string

+ 1
- 3
Doctrine/Extension/ImageTrait.php Просмотреть файл

@@ -7,9 +7,7 @@ use Doctrine\ORM\Mapping as ORM;

trait ImageTrait
{
/**
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\File\FileInterface", cascade={"persist", "remove"}, fetch="EAGER")
*/
#[ORM\ManyToOne(targetEntity: 'Lc\SovBundle\Model\File\FileInterface', cascade: ['persist', 'remove'], fetch: 'EAGER')]
protected $image;

public function getImage(): ?File

+ 3
- 9
Doctrine/Extension/OpenGraphTrait.php Просмотреть файл

@@ -8,19 +8,13 @@ use Lc\SovBundle\Model\File\FileInterface;

trait OpenGraphTrait
{
/**
* @ORM\Column(type="string", nullable=true)
*/
#[ORM\Column(type: 'string', nullable: true)]
protected $openGraphTitle;

/**
* @ORM\Column(type="text", nullable=true)
*/
#[ORM\Column(type: 'text', nullable: true)]
protected $openGraphDescription;

/**
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\File\FileInterface", cascade={"persist", "remove"})
*/
#[ORM\ManyToOne(targetEntity: 'Lc\SovBundle\Model\File\FileInterface', cascade: ['persist', 'remove'])]
protected $openGraphImage;

public function getOpenGraphTitle(): ?string

+ 3
- 7
Doctrine/Extension/SeoTrait.php Просмотреть файл

@@ -6,22 +6,18 @@ use Doctrine\ORM\Mapping as ORM;

trait SeoTrait
{
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
#[ORM\Column(type: 'string', length: 255, nullable: true)]
protected $metaTitle;


/**
* @ORM\Column(type="text", nullable=true)
*/
#[ORM\Column(type: 'text', nullable: true)]
protected $metaDescription;


/**
* @var array
* @ORM\Column(type="array", nullable=true)
*/
#[ORM\Column(type: 'array', nullable: true)]
protected $oldUrls;



+ 1
- 1
Doctrine/Extension/SluggableTrait.php Просмотреть файл

@@ -8,9 +8,9 @@ use Gedmo\Mapping\Annotation as Gedmo;
trait SluggableTrait
{
/**
* @ORM\Column(type="string", length=255)
* @Gedmo\Slug(fields={"title"}, unique=true)
*/
#[ORM\Column(type: 'string', length: 255)]
protected $slug;

public function getSlug(): ?string

+ 1
- 1
Doctrine/Extension/SortableTrait.php Просмотреть файл

@@ -10,8 +10,8 @@ trait SortableTrait
{
/**
* @var string
* @ORM\Column(type="float")
*/
#[ORM\Column(type: 'float')]
protected $position = 0;

/**

+ 1
- 3
Doctrine/Extension/StatusTrait.php Просмотреть файл

@@ -6,9 +6,7 @@ use Doctrine\ORM\Mapping as ORM;

trait StatusTrait
{
/**
* @ORM\Column(type="float")
*/
#[ORM\Column(type: 'float')]
protected $status;

public function getStatus(): ?float

+ 2
- 2
Doctrine/Extension/TimestampableTrait.php Просмотреть файл

@@ -8,15 +8,15 @@ use Gedmo\Mapping\Annotation as Gedmo;
trait TimestampableTrait
{
/**
* @ORM\Column(type="datetime")
* @Gedmo\Timestampable(on="create")
*/
#[ORM\Column(type: 'datetime')]
protected $createdAt;

/**
* @ORM\Column(type="datetime")
* @Gedmo\Timestampable(on="update")
*/
#[ORM\Column(type: 'datetime')]
protected $updatedAt;

public function getCreatedAt(): ?\DateTimeInterface

+ 1
- 3
Doctrine/Extension/TranslatableTrait.php Просмотреть файл

@@ -14,9 +14,7 @@ trait TranslatableTrait
*/
protected $locale;

/**
* @ORM\Column(type="array", nullable=true)
*/
#[ORM\Column(type: 'array', nullable: true)]
protected $localesEnabled = [];

public function __get($name)

+ 3
- 5
Doctrine/Pattern/AbstractFullEntity.php Просмотреть файл

@@ -23,9 +23,7 @@ use Gedmo\Mapping\Annotation as Gedmo;
use Lc\SovBundle\Doctrine\Extension\TimestampableTrait;


/**
* @ORM\MappedSuperclass
*/
#[ORM\MappedSuperclass]
abstract class AbstractFullEntity implements BlameableInterface, SeoInterface, OpenGraphInterface, SluggableInterface, SortableInterface,
StatusInterface, TimestampableInterface, DevAliasInterface, EntityInterface
{
@@ -41,14 +39,14 @@ abstract class AbstractFullEntity implements BlameableInterface, SeoInterface, O

/**
* @Gedmo\Translatable
* @ORM\Column(type="string", length=255)
*/
#[ORM\Column(type: 'string', length: 255)]
protected $title;

/**
* @Gedmo\Translatable
* @ORM\Column(type="text", nullable=true)
*/
#[ORM\Column(type: 'text', nullable: true)]
protected $description;



+ 1
- 3
Doctrine/Pattern/AbstractLightEntity.php Просмотреть файл

@@ -13,9 +13,7 @@ use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Lc\SovBundle\Doctrine\Extension\TimestampableTrait;

/**
* @ORM\MappedSuperclass
*/
#[ORM\MappedSuperclass]
abstract class AbstractLightEntity implements BlameableInterface, TimestampableInterface, DevAliasInterface,
EntityInterface
{

+ 6
- 12
Generator/CsvGenerator.php Просмотреть файл

@@ -6,23 +6,17 @@ use Symfony\Component\HttpFoundation\StreamedResponse;

class CsvGenerator
{
protected $arrayToExport;
protected $arrayToExport = array();
protected $columns;
protected $titleDocument;
protected $titleDocument = 'csv_file';

protected $convertEncoding ;
protected $fromEncoding ;
protected $toEncoding ;
protected $delimiter ;
protected $convertEncoding = false ;
protected $fromEncoding = 'UTF-8' ;
protected $toEncoding = 'ISO-8859-1' ;
protected $delimiter = ';' ;

public function __construct()
{
$this->arrayToExport = array();
$this->titleDocument = 'csv_file';
$this->convertEncoding = false ;
$this->fromEncoding = 'UTF-8' ;
$this->toEncoding = 'ISO-8859-1' ;
$this->delimiter = ';' ;
}

public function enableConvertEncoding($toEncoding, $fromEncoding = null)

+ 47
- 49
Model/File/FileModel.php Просмотреть файл

@@ -1,4 +1,5 @@
<?php

namespace Lc\SovBundle\Model\File;


@@ -17,54 +18,51 @@ use Lc\SovBundle\Doctrine\Extension\TranslatableInterface;
use Lc\SovBundle\Doctrine\Extension\TranslatableTrait;

abstract class FileModel implements SortableInterface, BlameableInterface, TimestampableInterface, TranslatableInterface,
DevAliasInterface, EntityInterface, FileInterface
DevAliasInterface, EntityInterface, FileInterface
{
use DevAliasTrait;
use BlameableTrait;
use TimestampableTrait;
use TranslatableTrait;
use SortableTrait;

/**
* @Gedmo\Translatable
* @ORM\Column(type="string", length=255, nullable=true)
*/
protected $path;

/**
* @Gedmo\Translatable
* @ORM\Column(type="string", length=255, nullable=true)
*/
protected $legend;


public function __toString(){
return ''.$this->getLegend();
}

public function getPath(): ?string
{
return $this->path;
}

public function setPath(?string $path): self
{
$this->path = $path;

return $this;
}


public function getLegend(): ?string
{
return $this->legend;
}

public function setLegend(?string $legend): self
{
$this->legend = $legend;

return $this;
}
use DevAliasTrait;
use BlameableTrait;
use TimestampableTrait;
use TranslatableTrait;
use SortableTrait;

#[Gedmo\Translatable]
#[ORM\Column(type: "string", length: 255, nullable: true)]
protected $path;

#[Gedmo\Translatable]
#[ORM\Column(type: "string", length: 255, nullable: true)]
protected $legend;


public function __toString()
{
return '' . $this->getLegend();
}

public function getPath(): ?string
{
return $this->path;
}

public function setPath(?string $path): self
{
$this->path = $path;

return $this;
}


public function getLegend(): ?string
{
return $this->legend;
}

public function setLegend(?string $legend): self
{
$this->legend = $legend;

return $this;
}

}

+ 3
- 9
Model/Newsletter/NewsletterModel.php Просмотреть файл

@@ -8,20 +8,14 @@ use Doctrine\Common\Collections\Collection;
use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity;
use Lc\SovBundle\Model\User\UserInterface;

/**
* @ORM\MappedSuperclass()
*/
#[ORM\MappedSuperclass]
abstract class NewsletterModel extends AbstractFullEntity implements NewsletterInterface
{

/**
* @ORM\ManyToMany(targetEntity="Lc\SovBundle\Model\User\UserInterface", mappedBy="newsletters")
*/
#[ORM\ManyToMany(targetEntity:"Lc\SovBundle\Model\User\UserInterface", mappedBy:"newsletters")]
protected $users;

/**
* @ORM\Column(type="boolean", nullable=true)
*/
#[ORM\Column(type:"boolean", nullable:true)]
protected $isMain;

public function __toString()

+ 10
- 29
Model/Reminder/ReminderModel.php Просмотреть файл

@@ -9,9 +9,7 @@ use Lc\SovBundle\Doctrine\EntityInterface;
use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;
use Lc\SovBundle\Model\User\UserInterface;

/**
* @ORM\MappedSuperclass()
*/
#[ORM\MappedSuperclass]
abstract class ReminderModel extends AbstractLightEntity implements ReminderInterface, EntityInterface
{
/**
@@ -19,51 +17,34 @@ abstract class ReminderModel extends AbstractLightEntity implements ReminderInte
*/
protected $relatedPage;

/**
* @ORM\Column(type="string", length=255)
*/
#[ORM\Column(type: 'string', length: 255)]
protected $title;

/**
* @ORM\Column(type="text", nullable=true)
*/
#[ORM\Column(type: 'text', nullable: true)]
protected $description;

/**
* @ORM\Column(type="string", length=64, nullable=true)
*/
#[ORM\Column(type: 'string', length: 64, nullable: true)]
protected $crudAction;

/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
#[ORM\Column(type: 'string', length: 255, nullable: true)]
protected $crudControllerFqcn;

/**
* @ORM\Column(type="integer", nullable=true)
*/
#[ORM\Column(type: 'integer', nullable: true)]
protected $entityId;

/**
* @ORM\ManyToMany(targetEntity="Lc\SovBundle\Model\User\UserInterface")
*/
#[ORM\ManyToMany(targetEntity: 'Lc\SovBundle\Model\User\UserInterface')]
protected $users;

/**
* @ORM\Column(type="date", nullable=true)
*/
#[ORM\Column(type: 'date', nullable: true)]
protected $dateReminder;

/**
* @ORM\Column(type="boolean", nullable=false)
*/
protected $done;
#[ORM\Column(type: 'boolean', nullable: false)]
protected $done = false;


public function __construct()
{
$this->users = new ArrayCollection();
$this->done = false;
}

public function getTitle(): ?string

+ 5
- 15
Model/Setting/SettingModel.php Просмотреть файл

@@ -5,29 +5,19 @@ namespace Lc\SovBundle\Model\Setting;
use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\File\FileInterface;

/**
* @ORM\MappedSuperclass()
*/
#[ORM\MappedSuperclass]
abstract class SettingModel implements SettingInterface
{
/**
* @ORM\Column(type="string", length=63, nullable=true)
*/
#[ORM\Column(type: 'string', length: 63, nullable: true)]
protected $name;

/**
* @ORM\Column(type="text", nullable=true)
*/
#[ORM\Column(type: 'text', nullable: true)]
protected $text;

/**
* @ORM\Column(type="datetime", nullable=true)
*/
#[ORM\Column(type: 'datetime', nullable: true)]
protected $date;

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

public function getName(): ?string

+ 2
- 4
Model/Setting/SiteSettingModel.php Просмотреть файл

@@ -8,10 +8,8 @@ use Lc\SovBundle\Model\Site\SiteInterface;

abstract class SiteSettingModel extends SettingModel implements SiteSettingInterface, EntityInterface
{
/**
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\Site\SiteInterface", inversedBy="settings")
* @ORM\JoinColumn(nullable=false)
*/
#[ORM\ManyToOne(targetEntity:"Lc\SovBundle\Model\Site\SiteInterface", inversedBy: "settings")]
#[ORM\JoinColumn(nullable: false)]
protected $site;

public function getSite(): ?SiteInterface

+ 6
- 16
Model/Site/NewsModel.php Просмотреть файл

@@ -10,30 +10,20 @@ use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity;
use Lc\SovBundle\Model\File\FileInterface;
use Lc\SovBundle\Model\Newsletter\NewsletterInterface;

/**
* @ORM\MappedSuperclass()
*/
#[ORM\MappedSuperclass()]
abstract class NewsModel extends AbstractFullEntity implements NewsInterface
{
/**
* @ORM\Column(type="datetime")
* @Gedmo\Timestampable(on="create")
*/
#[ORM\Column(type: "datetime")]
#[Gedmo\Timestampable(on: "create")]
protected $date;

/**
* @ORM\Column(type="boolean", nullable=true)
*/
#[ORM\Column(type: "boolean", nullable: true)]
protected $isSent;

/**
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\Newsletter\NewsletterInterface")
*/
#[ORM\ManyToOne(targetEntity: "Lc\SovBundle\Model\Newsletter\NewsletterInterface")]
protected $newsletter;

/**
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\File\FileInterface", cascade={"persist", "remove"})
*/
#[ORM\ManyToOne(targetEntity: "Lc\SovBundle\Model\Newsletter\FileInterface", cascade: ["persist", "remove"])]
protected $image;

public function __toString()

+ 1
- 3
Model/Site/PageModel.php Просмотреть файл

@@ -5,9 +5,7 @@ namespace Lc\SovBundle\Model\Site;
use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity;

/**
* @ORM\MappedSuperclass()
*/
#[ORM\MappedSuperclass]
abstract class PageModel extends AbstractFullEntity implements PageInterface
{


+ 1
- 3
Model/Site/SiteModel.php Просмотреть файл

@@ -14,9 +14,7 @@ abstract class SiteModel implements SiteInterface, EntityInterface, DevAliasInte
{
use DevAliasTrait;

/**
* @ORM\OneToMany(targetEntity="Lc\SovBundle\Model\Setting\SiteSettingInterface", mappedBy="site", orphanRemoval=true, cascade={"persist"}, fetch="EAGER")
*/
#[ORM\OneToMany(targetEntity:"Lc\SovBundle\Model\Setting\SiteSettingInterface", mappedBy:"site", orphanRemoval:true, cascade:['persist'], fetch:"EAGER")]
protected $settings;

public function __construct()

+ 6
- 16
Model/Ticket/TicketMessageModel.php Просмотреть файл

@@ -10,32 +10,22 @@ use Lc\SovBundle\Doctrine\Extension\StatusInterface;
use Lc\SovBundle\Doctrine\Extension\StatusTrait;
use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;

/**
* @ORM\MappedSuperclass()
*/
#[ORM\MappedSuperclass]
abstract class TicketMessageModel extends AbstractLightEntity implements TicketMessageInterface, EntityInterface, StatusInterface
{
use StatusTrait;

/**
* @ORM\Column(type="text")
*/
#[ORM\Column(type: 'text')]
protected $message;

/**
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\Ticket\TicketInterface", inversedBy="ticketMessages")
* @ORM\JoinColumn(nullable=false)
*/
#[ORM\ManyToOne(targetEntity: 'Lc\SovBundle\Model\Ticket\TicketInterface', inversedBy: 'ticketMessages')]
#[ORM\JoinColumn(nullable: false)]
protected $ticket;

/**
* @ORM\Column(type="boolean", nullable=true)
*/
#[ORM\Column(type: 'boolean', nullable: true)]
protected $answerByAdmin;

/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
#[ORM\Column(type: "string", length: 255, nullable: true)]
protected $imageFilename;

public function __toString()

+ 12
- 34
Model/Ticket/TicketModel.php Просмотреть файл

@@ -11,9 +11,7 @@ use Lc\SovBundle\Doctrine\Extension\BlameableNullableTrait;
use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;
use Lc\SovBundle\Model\User\UserInterface;

/**
* @ORM\MappedSuperclass()
*/
#[ORM\MappedSuperclass]
abstract class TicketModel extends AbstractLightEntity implements TicketInterface, EntityInterface
{

@@ -25,55 +23,35 @@ abstract class TicketModel extends AbstractLightEntity implements TicketInterfac
const TICKET_STATUS_PROCESSED = 'processed';
const TICKET_STATUS_CLOSED = 'closed';

/**
* @ORM\Column(type="string", length=32)
*/
#[ORM\Column(type: 'string', length: 32)]
protected $type;

/**
* @ORM\Column(type="string", length=32)
*/
#[ORM\Column(type: 'string', length: 32)]
protected $status = self::TICKET_STATUS_OPEN;

/**
* @ORM\Column(type="string", length=255)
*/
#[ORM\Column(type: 'string', length: 255)]
protected $subject;

/**
* @ORM\Column(type="array", nullable=true)
*/
#[ORM\Column(type: 'array', nullable: true)]
protected $tags = [];

/**
* @ORM\Column(type="string", length=64, nullable=true)
*/
#[ORM\Column(type: 'string', length: 64, nullable: true)]
protected $visitorFirstname;

/**
* @ORM\Column(type="string", length=64, nullable=true)
*/
#[ORM\Column(type: 'string', length: 64, nullable: true)]
protected $visitorLastname;

/**
* @ORM\Column(type="string", length=128, nullable=true)
*/
#[ORM\Column(type: 'string', length: 128, nullable: true)]
protected $visitorEmail;

/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
#[ORM\Column(type: "string", length: 255, nullable: true)]
protected $visitorToken;

/**
* @ORM\OneToMany(targetEntity="Lc\SovBundle\Model\Ticket\TicketMessageInterface", mappedBy="ticket",cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"id" = "ASC"})
*/
#[ORM\OneToMany(targetEntity: 'Lc\SovBundle\Model\Ticket\TicketMessageInterface', mappedBy: 'ticket', cascade: ['persist', 'remove'], orphanRemoval: true)]
#[ORM\OrderBy(['id' => 'ASC'])]
protected $ticketMessages;

/**
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface", inversedBy="tickets")
*/
#[ORM\ManyToOne(targetEntity: 'Lc\SovBundle\Model\User\UserInterface', inversedBy: 'tickets')]
protected $user;



+ 2
- 6
Model/User/GroupUserModel.php Просмотреть файл

@@ -9,15 +9,11 @@ use Lc\SovBundle\Doctrine\EntityInterface;
use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity;
use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;

/**
* @ORM\MappedSuperclass()
*/
#[ORM\MappedSuperclass]
abstract class GroupUserModel extends AbstractFullEntity implements GroupUserInterface, EntityInterface
{

/**
* @ORM\ManyToMany(targetEntity="Lc\SovBundle\Model\User\UserInterface", mappedBy="groupUsers")
*/
#[ORM\ManyToMany(targetEntity: 'Lc\SovBundle\Model\User\UserInterface', mappedBy: 'groupUsers')]
protected $users;



+ 14
- 40
Model/User/UserModel.php Просмотреть файл

@@ -14,78 +14,52 @@ use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
use Symfony\Component\Security\Core\User\UserInterface;
use Lc\SovBundle\Model\User\UserInterface as SovUserInterface;

/**
* @ORM\MappedSuperclass()
*/
#[ORM\MappedSuperclass]
abstract class UserModel implements EntityInterface, UserInterface, SovUserInterface, DevAliasInterface, PasswordAuthenticatedUserInterface
{
use DevAliasTrait;
use TimestampableTrait;

/**
* @ORM\Column(type="string", length=180, unique=true)
*/
#[ORM\Column(type: 'string', length: 180, unique: true)]
protected $email;

/**
* @ORM\Column(type="json")
*/
#[ORM\Column(type: 'json')]
protected $roles = [];

/**
* @var string The hashed password
* @ORM\Column(type="string")
*/
#[ORM\Column(type: 'string')]
protected $password;

/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
#[ORM\Column(type: "string", length: 255, nullable: true)]
protected $lastname;

/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
#[ORM\Column(type: "string", length: 255, nullable: true)]
protected $firstname;

/**
* @ORM\Column(type="string", length=20, nullable=true)
*/
#[ORM\Column(type: 'string', length: 20, nullable: true)]
protected $phone;

/**
* @ORM\Column(type="boolean", nullable=true)
*/
#[ORM\Column(type: 'boolean', nullable: true)]
protected $gender;

/**
* @ORM\Column(type="date", nullable=true)
*/
#[ORM\Column(type: 'date', nullable: true)]
protected $birthdate;

/**
* @ORM\Column(type="boolean")
*/
#[ORM\Column(type: 'boolean')]
protected $isVerified = false;

/**
* @ORM\ManyToMany(targetEntity="Lc\SovBundle\Model\User\GroupUserInterface", inversedBy="users")
*/
#[ORM\ManyToMany(targetEntity: 'Lc\SovBundle\Model\User\GroupUserInterface', inversedBy: 'users')]
protected $groupUsers;

/**
* @ORM\OneToMany(targetEntity="Lc\SovBundle\Model\Ticket\TicketInterface", mappedBy="user", cascade={"remove"})
*/
#[ORM\OneToMany(targetEntity: 'Lc\SovBundle\Model\Ticket\TicketInterface', mappedBy: 'user', cascade: ['remove'])]
protected $tickets;

/**
* @ORM\Column(type="array", nullable=true)
*/
#[ORM\Column(type: 'array', nullable: true)]
protected $ticketTypesNotification = [];

/**
* @ORM\Column(type="datetime", nullable=true)
*/
#[ORM\Column(type: 'datetime', nullable: true)]
protected $lastLogin;

public function __construct()

Загрузка…
Отмена
Сохранить