|
- <?php
-
- namespace Lc\ShopBundle\Controller;
-
- use App\Entity\Merchant;
- use Lc\ShopBundle\Context\MerchantInterface;
-
- class MerchantController extends AbstractController
- {
- protected $repo;
- public function __construct()
- {
- $this->repo = $this->em->getRepository(MerchantInterface::class);
-
- }
-
-
- public function edit(){
- $merchant = new Merchant();
- $merchant->setCreatedBy($this->user);
- $merchant->setUpdatedBy($this->user);
-
- $this->em->persist($merchant);
- $this->em->flush();
- die();
-
- $merchant = $this->repo->find($id);
- dump($merchant);
-
- return $this->render('@LcShop/merchant/edit.html.twig', [
-
- ]);
- }
-
-
- public function list(){
- return $this->render('merchant/index.html.twig', [
- 'controller_name' => 'MerchantController',
- ]);
- }
-
-
- }
|