{ | { | ||||
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'); |
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'); |
$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'); |
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( |
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(); |
$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(); |
/** | /** | ||||
* @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; | ||||
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 |
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 |
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 |
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; | ||||
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 |
{ | { | ||||
/** | /** | ||||
* @var string | * @var string | ||||
* @ORM\Column(type="float") | |||||
*/ | */ | ||||
#[ORM\Column(type: 'float')] | |||||
protected $position = 0; | protected $position = 0; | ||||
/** | /** |
trait StatusTrait | trait StatusTrait | ||||
{ | { | ||||
/** | |||||
* @ORM\Column(type="float") | |||||
*/ | |||||
#[ORM\Column(type: 'float')] | |||||
protected $status; | protected $status; | ||||
public function getStatus(): ?float | public function getStatus(): ?float |
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 |
*/ | */ | ||||
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) |
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; | ||||
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 | ||||
{ | { |
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) |
<?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; | |||||
} | |||||
} | } |
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() |
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 |
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 |
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 |
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() |
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 | ||||
{ | { | ||||
{ | { | ||||
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() |
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() |
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; | ||||
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; | ||||
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() |