Quellcode durchsuchen

Gestion des utilisateurs

reduction
Guillaume vor 4 Jahren
Ursprung
Commit
f90f6e1ba7
2 geänderte Dateien mit 31 neuen und 1 gelöschten Zeilen
  1. +4
    -1
      ShopBundle/Controller/Admin/AdminController.php
  2. +27
    -0
      ShopBundle/Controller/Admin/UserController.php

+ 4
- 1
ShopBundle/Controller/Admin/AdminController.php Datei anzeigen

@@ -4,16 +4,19 @@ namespace Lc\ShopBundle\Controller\Admin;

use EasyCorp\Bundle\EasyAdminBundle\Controller\EasyAdminController;
use EasyCorp\Bundle\EasyAdminBundle\Event\EasyAdminEvents;
use FOS\UserBundle\Model\UserManagerInterface;
use Lc\ShopBundle\Context\MerchantInterface;
use Symfony\Component\Security\Core\Security;

class AdminController extends EasyAdminController
{
protected $security;
protected $userManager;

public function __construct(Security $security)
public function __construct(Security $security, UserManagerInterface $userManager)
{
$this->security = $security;
$this->userManager = $userManager ;
}

protected function createListQueryBuilder($entityClass, $sortDirection, $sortField = null, $dqlFilter = null)

+ 27
- 0
ShopBundle/Controller/Admin/UserController.php Datei anzeigen

@@ -0,0 +1,27 @@
<?php

namespace Lc\ShopBundle\Controller\Admin;

use FOS\UserBundle\Doctrine\UserManager;
use FOS\UserBundle\Model\UserManagerInterface ;

class UserController extends AdminController
{

public function createNewEntity()
{
return $this->userManager->createUser();
}

public function persistEntity($user)
{
$this->userManager->updateUser($user, false);
parent::persistEntity($user);
}

public function updateEntity($user)
{
$this->userManager->updateUser($user, false);
parent::updateEntity($user);
}
}

Laden…
Abbrechen
Speichern