WellCommerce\Bundle\DoctrineBundle\Helper\Doctrine\DoctrineHelperInterface::getEntityManager PHP Method

getEntityManager() public method

Returns Doctrine manager
public getEntityManager ( ) : Doctrine\Common\Persistence\ObjectManager | object
return Doctrine\Common\Persistence\ObjectManager | object
    public function getEntityManager();

Usage Example

 private function duplicateTranslatableEntity(LocaleAwareInterface $entity, array $properties, LocaleInterface $targetLocale)
 {
     $duplicate = clone $entity;
     foreach ($properties as $propertyName) {
         $value = sprintf('%s-%s', $this->propertyAccessor->getValue($entity, $propertyName), $targetLocale->getCode());
         $this->propertyAccessor->setValue($duplicate, $propertyName, $value);
         $duplicate->setLocale($targetLocale->getCode());
         $this->doctrineHelper->getEntityManager()->persist($duplicate);
     }
 }
All Usage Examples Of WellCommerce\Bundle\DoctrineBundle\Helper\Doctrine\DoctrineHelperInterface::getEntityManager