Category : entitymanager

I am implementing symfony security. My User entity is in another database. I have multiples enties managers. So far I can’t get the entitymanager to read User table, which in my case is not the default entitymanager. This is my security.yaml security: encoders: AppEntityUser: id: ‘AppSecurityEncoderMyCustomPasswordEncoder’ #app_encoder: #para oracle # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers providers: # used to ..

Read more

I have entities which are managed by two entity managers in Symfony 4 project and I would like to load fixtures from both connections for functional tests. For instance : class AdapterTest extends KernelTestCase { use FixturesTrait; … protected function setUp(): void { self::bootKernel(); // Not working, just for example $this->loadFixtures([CounterFixtures::class], false, ‘counter’); $this->loadFixtures([CountryFixtures::class]); … ..

Read more

I have defined two different entity managers in doctrine.yaml entity_managers: EM1: naming_strategy: doctrine.orm.naming_strategy.underscore mappings: AppEM1: is_bundle: false type: annotation dir: ‘%kernel.project_dir%/src/BC1/Domain/Entity’ prefix: ‘BC1DomainEntity’ alias: AppEM1 EM2: naming_strategy: doctrine.orm.naming_strategy.underscore mappings: AppEM2: is_bundle: false type: annotation dir: ‘%kernel.project_dir%/src/BC2/Domain/Entity’ prefix: ‘BC2DomainEntity’ alias: AppEM2 and I am injecting a Doctrine EntityManagerInterface in my service: service.yaml DoctrineRepository: class: BCInfrastructurePersistenceDoctrineRepository arguments: ..

Read more

Doctrine advises that – Calling DoctrineORMEntityManager::clear() with any arguments to clear specific entities is deprecated since doctrine/persistence 1.3 and will be removed in 2.0. We have a lot of references to ->clear(SpecificEntity::class) in our Symfony codebase and are looking to update these, but we’re struggling to find a suggested replacement in the latest upgrade guide. ..

Read more

I’m trying to work with kayue/KayueWordpressBundle installed with composer as composer require kayue/kayue-wordpress-bundle in my Symfony 4.4.1 project but I’m unable to. This is what I’m trying to do: <?php namespace AppServiceWordPress; use DoctrineORMEntityManagerInterface; use KayueWordpressBundleEntityPost; class PostCollection { protected $postRepository; public function __construct(EntityManagerInterface $entityManager) { $this->postRepository = $entityManager->getRepository(Post::class); } } The error I get: ..

Read more