Skip to content
Advertisement

Tag: doctrine-orm

The Symfone “doctrine:fixtures:load” command missing

I have Symfony 3.1 project with Doctrine and doctrine/doctrine-fixtures-bundle and doctrine/data-fixtures installed. However, when i run a console command php bin/console doctrine:fixtures:load i get a message saying that there are no commands defined in the doctrine:fixtures namespace. The class DoctrineBundleFixturesBundleCommandLoadDataFixturesDoctrineCommand exists. Please suggest how to fix that. Answer Run first php bin/console and see if the command appear in the

logged user does not have all fields filled up

I’m using Symfony 2.8 and Doctrine and I have security.yml configured to point to the User class which implements UserInterface. My ORM schema is in YAML. The problem: In database the user has also specified “email” field, Symfony for LOGGED USER is not filling up that field and also “password” field is empty. When I do $this->get(‘doctrine.orm.entity_manager’)->clear(User::class); then the entity

Symfony get connected user id from entity

In a Symfony2.8/Doctrine2 application, I need to store in each row of my SQL tables the id of the user who created or updated the row (users can connect with Ldap). So all my entities inherited of a GenericEntity which contains this variable (type would be string if I want to store Ldap username): And I use the prePersistCallback() to

Semantical Error: Class MailileoBundleEntityMatch has no field or association named getMailid

I went through all similar issues but nothing appears to solve my problem. I’ve put a simple query in my MatchRepository but it throws a semantic error. I’ve double(triple) checked my entity and everything looks fine. It even works fine when I pull all Matches via findAll() and then run a $match->getMailid() The problem appears only in the MatchRepository file.

PHP Mocking Final Class

I am attempting to mock a php final class but since it is declared final I keep receiving this error: PHPUnit_Framework_Exception: Class “DoctrineORMQuery” is declared “final” and cannot be mocked. Is there anyway to get around this final behavior just for my unit tests without introducing any new frameworks? Answer Since you mentioned you don’t want to use any other

Doctrine migrations table collation

Trying to find a way to programatically create tables with certain collation, but can’t seem to find a way how to do it properly. I am using the “doctrine/doctrine-migrations-bundle”: “2.1.*@dev” and Symfony 2.3, I set up in my config.yml: It creates the database with LATIN1 charset and latin1_swedish_ci as default collation, when I run doctrine:database:create tool. Then I run my

Advertisement