Browse Source

Php8 passage d'annotation à attribut

feature/symfony6.1
Fabien Normand 1 year ago
parent
commit
4ac2f3a437
31 changed files with 148 additions and 313 deletions
  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 View File

{ {
use ControllerTrait; 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) public function cacheClear(Request $request)
{ {
$this->doCommand('cache:clear'); $this->doCommand('cache:clear');

+ 1
- 3
Controller/Dashboard/DashboardAdminController.php View File



use ControllerTrait; use ControllerTrait;


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

+ 4
- 12
Controller/Reminder/ReminderAdminController.php View File

$this->parameterBag = $parameterBag; $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 public function renderModal(Request $request): Response
{ {
$id = $request->get('id'); $id = $request->get('id');
); );
} }


/**
* @Route("/admin/reminder/new", name="sov_admin_reminder_new")
*/
#[Route(path: '/admin/reminder/new', name: 'sov_admin_reminder_new')]
public function new(Request $request) public function new(Request $request)
{ {
$reminder = $this->createEntity(); $reminder = $this->createEntity();
return $this->redirect($request->headers->get('referer')); 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) public function edit(Request $request)
{ {
$id = $request->get('id'); $id = $request->get('id');
return $this->redirect($request->headers->get('referer')); 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 public function done(Request $request): JsonResponse
{ {
$id = $request->get('id'); $id = $request->get('id');

+ 2
- 6
Controller/Security/SecurityAdminController.php View File



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


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

+ 1
- 3
Controller/Setting/SettingAdminController.php View File



class SettingAdminController extends AbstractController 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) public function manageGlobal(Request $request)
{ {
$entityManager = $this->getEntityManager(); $entityManager = $this->getEntityManager();

+ 2
- 6
Controller/User/AccountAdminController.php View File

$this->entityManager = $entityManager; $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 public function profile(Request $request): Response
{ {
$user = $this->getUser(); $user = $this->getUser();
); );
} }


/**
* @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 public function changePassword(Request $request, UserPasswordHasherInterface $passwordEncoder): Response
{ {
$user = $this->getUser(); $user = $this->getUser();

+ 4
- 4
Doctrine/Extension/BlameableTrait.php View File



/** /**
* @Gedmo\Blameable(on="create") * @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; protected $createdBy;


/** /**
* @Gedmo\Blameable(on="update") * @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; protected $updatedBy;





+ 1
- 3
Doctrine/Extension/DevAliasTrait.php View File

trait DevAliasTrait trait DevAliasTrait
{ {


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


public function getDevAlias(): ?string public function getDevAlias(): ?string

+ 1
- 3
Doctrine/Extension/ImageTrait.php View File



trait ImageTrait 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; protected $image;


public function getImage(): ?File public function getImage(): ?File

+ 3
- 9
Doctrine/Extension/OpenGraphTrait.php View File



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


/**
* @ORM\Column(type="text", nullable=true)
*/
#[ORM\Column(type: 'text', nullable: true)]
protected $openGraphDescription; 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; protected $openGraphImage;


public function getOpenGraphTitle(): ?string public function getOpenGraphTitle(): ?string

+ 3
- 7
Doctrine/Extension/SeoTrait.php View File



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




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




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





+ 1
- 1
Doctrine/Extension/SluggableTrait.php View File

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


public function getSlug(): ?string public function getSlug(): ?string

+ 1
- 1
Doctrine/Extension/SortableTrait.php View File

{ {
/** /**
* @var string * @var string
* @ORM\Column(type="float")
*/ */
#[ORM\Column(type: 'float')]
protected $position = 0; protected $position = 0;


/** /**

+ 1
- 3
Doctrine/Extension/StatusTrait.php View File



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


public function getStatus(): ?float public function getStatus(): ?float

+ 2
- 2
Doctrine/Extension/TimestampableTrait.php View File

trait TimestampableTrait trait TimestampableTrait
{ {
/** /**
* @ORM\Column(type="datetime")
* @Gedmo\Timestampable(on="create") * @Gedmo\Timestampable(on="create")
*/ */
#[ORM\Column(type: 'datetime')]
protected $createdAt; protected $createdAt;


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


public function getCreatedAt(): ?\DateTimeInterface public function getCreatedAt(): ?\DateTimeInterface

+ 1
- 3
Doctrine/Extension/TranslatableTrait.php View File

*/ */
protected $locale; protected $locale;


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


public function __get($name) public function __get($name)

+ 3
- 5
Doctrine/Pattern/AbstractFullEntity.php View File

use Lc\SovBundle\Doctrine\Extension\TimestampableTrait; use Lc\SovBundle\Doctrine\Extension\TimestampableTrait;




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


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


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





+ 1
- 3
Doctrine/Pattern/AbstractLightEntity.php View File

use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Mapping\Annotation as Gedmo;
use Lc\SovBundle\Doctrine\Extension\TimestampableTrait; use Lc\SovBundle\Doctrine\Extension\TimestampableTrait;


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

+ 6
- 12
Generator/CsvGenerator.php View File



class CsvGenerator class CsvGenerator
{ {
protected $arrayToExport;
protected $arrayToExport = array();
protected $columns; 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() 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) public function enableConvertEncoding($toEncoding, $fromEncoding = null)

+ 47
- 49
Model/File/FileModel.php View File

<?php <?php

namespace Lc\SovBundle\Model\File; namespace Lc\SovBundle\Model\File;




use Lc\SovBundle\Doctrine\Extension\TranslatableTrait; use Lc\SovBundle\Doctrine\Extension\TranslatableTrait;


abstract class FileModel implements SortableInterface, BlameableInterface, TimestampableInterface, TranslatableInterface, 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 View File

use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity; use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity;
use Lc\SovBundle\Model\User\UserInterface; use Lc\SovBundle\Model\User\UserInterface;


/**
* @ORM\MappedSuperclass()
*/
#[ORM\MappedSuperclass]
abstract class NewsletterModel extends AbstractFullEntity implements NewsletterInterface 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; protected $users;


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


public function __toString() public function __toString()

+ 10
- 29
Model/Reminder/ReminderModel.php View File

use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity; use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;
use Lc\SovBundle\Model\User\UserInterface; use Lc\SovBundle\Model\User\UserInterface;


/**
* @ORM\MappedSuperclass()
*/
#[ORM\MappedSuperclass]
abstract class ReminderModel extends AbstractLightEntity implements ReminderInterface, EntityInterface abstract class ReminderModel extends AbstractLightEntity implements ReminderInterface, EntityInterface
{ {
/** /**
*/ */
protected $relatedPage; protected $relatedPage;


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


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


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


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


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


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


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


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




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


public function getTitle(): ?string public function getTitle(): ?string

+ 5
- 15
Model/Setting/SettingModel.php View File

use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\File\FileInterface; use Lc\SovBundle\Model\File\FileInterface;


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


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


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


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


public function getName(): ?string public function getName(): ?string

+ 2
- 4
Model/Setting/SiteSettingModel.php View File



abstract class SiteSettingModel extends SettingModel implements SiteSettingInterface, EntityInterface 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; protected $site;


public function getSite(): ?SiteInterface public function getSite(): ?SiteInterface

+ 6
- 16
Model/Site/NewsModel.php View File

use Lc\SovBundle\Model\File\FileInterface; use Lc\SovBundle\Model\File\FileInterface;
use Lc\SovBundle\Model\Newsletter\NewsletterInterface; use Lc\SovBundle\Model\Newsletter\NewsletterInterface;


/**
* @ORM\MappedSuperclass()
*/
#[ORM\MappedSuperclass()]
abstract class NewsModel extends AbstractFullEntity implements NewsInterface 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; protected $date;


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


/**
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\Newsletter\NewsletterInterface")
*/
#[ORM\ManyToOne(targetEntity: "Lc\SovBundle\Model\Newsletter\NewsletterInterface")]
protected $newsletter; 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; protected $image;


public function __toString() public function __toString()

+ 1
- 3
Model/Site/PageModel.php View File

use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity; use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity;


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



+ 1
- 3
Model/Site/SiteModel.php View File

{ {
use DevAliasTrait; 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; protected $settings;


public function __construct() public function __construct()

+ 6
- 16
Model/Ticket/TicketMessageModel.php View File

use Lc\SovBundle\Doctrine\Extension\StatusTrait; use Lc\SovBundle\Doctrine\Extension\StatusTrait;
use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity; use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;


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


/**
* @ORM\Column(type="text")
*/
#[ORM\Column(type: 'text')]
protected $message; 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; protected $ticket;


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


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


public function __toString() public function __toString()

+ 12
- 34
Model/Ticket/TicketModel.php View File

use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity; use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;
use Lc\SovBundle\Model\User\UserInterface; use Lc\SovBundle\Model\User\UserInterface;


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


const TICKET_STATUS_PROCESSED = 'processed'; const TICKET_STATUS_PROCESSED = 'processed';
const TICKET_STATUS_CLOSED = 'closed'; const TICKET_STATUS_CLOSED = 'closed';


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


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


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


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


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


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


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


/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
#[ORM\Column(type: "string", length: 255, nullable: true)]
protected $visitorToken; 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; protected $ticketMessages;


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





+ 2
- 6
Model/User/GroupUserModel.php View File

use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity; use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity;
use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity; use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;


/**
* @ORM\MappedSuperclass()
*/
#[ORM\MappedSuperclass]
abstract class GroupUserModel extends AbstractFullEntity implements GroupUserInterface, EntityInterface 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; protected $users;





+ 14
- 40
Model/User/UserModel.php View File

use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\User\UserInterface;
use Lc\SovBundle\Model\User\UserInterface as SovUserInterface; use Lc\SovBundle\Model\User\UserInterface as SovUserInterface;


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


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


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


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


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


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


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


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


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


/**
* @ORM\Column(type="boolean")
*/
#[ORM\Column(type: 'boolean')]
protected $isVerified = false; 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; 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; protected $tickets;


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


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


public function __construct() public function __construct()

Loading…
Cancel
Save