Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- public function __construct(ContainerInterface $service, Logger $logger)
- {
- $this->service = $service;
- $this->logger = $logger;
- }
- public function save()
- {
- $em = $this->service->get('doctrine')->getManager();
- $test = new Products();
- $test->setName('12333333333333333333333');
- try{
- $em->persist($test);
- $em->flush();
- }catch(\Exception $e){
- throw new Exception($e->getMessage());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement