Inital commit

This commit is contained in:
2020-11-19 15:36:28 +01:00
parent 71f32f83d3
commit 66ce4ee218
18077 changed files with 2166122 additions and 35184 deletions

View File

@@ -12,6 +12,7 @@
namespace Thelia\Action;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\Profile\ProfileEvent;
use Thelia\Core\Event\TheliaEvents;
@@ -29,13 +30,15 @@ class Profile extends BaseAction implements EventSubscriberInterface
{
/**
* @param ProfileEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function create(ProfileEvent $event)
public function create(ProfileEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
$profile = new ProfileModel();
$profile
->setDispatcher($event->getDispatcher())
->setDispatcher($dispatcher)
->setCode($event->getCode())
->setLocale($event->getLocale())
->setTitle($event->getTitle())
@@ -51,13 +54,14 @@ class Profile extends BaseAction implements EventSubscriberInterface
/**
* @param ProfileEvent $event
* @param $eventName
* @param EventDispatcherInterface $dispatcher
*/
public function update(ProfileEvent $event)
public function update(ProfileEvent $event, $eventName, EventDispatcherInterface $dispatcher)
{
if (null !== $profile = ProfileQuery::create()->findPk($event->getId())) {
$profile
->setDispatcher($event->getDispatcher())
->setDispatcher($dispatcher)
->setLocale($event->getLocale())
->setTitle($event->getTitle())
->setChapo($event->getChapo())
@@ -85,10 +89,9 @@ class Profile extends BaseAction implements EventSubscriberInterface
$profileResource = new ProfileResource();
$profileResource->setProfileId($event->getId())
->setResource(ResourceQuery::create()->findOneByCode($resourceCode))
->setAccess( $manager->getAccessValue() );
->setAccess($manager->getAccessValue());
$profileResource->save();
}
$event->setProfile($profile);
@@ -109,10 +112,9 @@ class Profile extends BaseAction implements EventSubscriberInterface
$profileModule = new ProfileModule();
$profileModule->setProfileId($event->getId())
->setModule(ModuleQuery::create()->findOneByCode($moduleCode))
->setAccess( $manager->getAccessValue() );
->setAccess($manager->getAccessValue());
$profileModule->save();
}
$event->setProfile($profile);
@@ -125,7 +127,6 @@ class Profile extends BaseAction implements EventSubscriberInterface
public function delete(ProfileEvent $event)
{
if (null !== $profile = ProfileQuery::create()->findPk($event->getId())) {
$profile
->delete()
;