2725 search results for Doctrine

Just a brief note: Loading the fixtures tends to break when using a PostgreSQL database. As user is a reserved keyword in PostgreSQL and can only be used with double quotes in all sql queries. Doctrine unfortunately ...
Hi, I am struggling to create sub query using doctrine. My raw query works fine and return records. Raw SQL ` SELECT * FROM tag WHERE platform_id = 2 AND id NOT IN ( SELECT tag_id FROM certificate WHERE ...
... store your files inside "Resources/config/doctrine" (in your bundle) and Symfony will find them, but do not try to use more than one type of mapping, because Symfony reads only one type of mapping. You can get more ...
MolloKhan
MolloKhan
Read Full Comment
... doctrine/annotations ``` The tutorial ships with version 1.2.4, and this bug was fixed in 1.2.5. Sheesh, bad luck :). Let me know if that works! I'm going to update the code download now to use that new version. Cheers!
weaverryan
weaverryan
Read Full Comment
Hey Nan, You probably means how to do it in Symfony Flex. Looks like this bundle somehow does not a Symfony recipe. I also wonder why, so I opened an issue: https://github.com/doctrine/DoctrineCacheBundle/issues/131 ...
Hey Robertino V.! Hmm, let's see if we can debug this nasty issue :). Ah, yep, I see it! It's really subtle! Notice that the error says that it could not load the type "Doctrine\DBAL\Types\DateType". The class you ...
weaverryan
weaverryan
Read Full Comment
... ', true) ->groupBy('genus.id') ->orderBy('max_created_at', 'DESC') ->getQuery() ->execute(); } The most important change was to make max_created_at to be HIDDEN. (Without HIDDEN doctrine didn't return array of objects, but array of arrays which contain max_created_at and a Genus object.) Best regards!
Damjan Ribovski
Damjan Ribovski
Read Full Comment
So that means that grouping is done on PHP side instead of MySQL side. For large "denormalized" data set that might be too inefficient. Is there a way to make Doctrine execute SQL similar to this one: SELECT g0_.id ...
Damjan Ribovski
Damjan Ribovski
Read Full Comment
... \GenusFormType::AppBundle\Form\{closure}() must be an instance of AppBundle\Repository\UserRepository, instance of Doctrine\ORM\EntityRepository given and it shows me: in src\AppBundle\Form\GenusFormType.php (line 57) ->add ...
Krzysztof
Krzysztof
Read Full Comment
... everything and return false if there was any constraint violation. And, about SQL injection, if you are using DQL (Doctrine Query Language) you have nothing to worry about 2) Well, for that case (that I don't recommend ...
MolloKhan
MolloKhan
Read Full Comment
Hey Mohammad Althayabeh! Ah, ok! I see it! Removing the `@ORM\Column`. That is confusing Doctrine: it's mapping it both as a normal column... and a relationship. You'll also need to reset your database after doing this ...
weaverryan
weaverryan
Read Full Comment
Hey Syed, I think you can move flush() out of the foreach statement, so Doctrine will just persist() all the objects first and then flush() them at once. Yes, you can register NelmioAliceBundle in your AppKernel and ...
... which already in DB, use persist() only when creating a new User with "$user = new User()", i.e. for those entities which Doctrine do not know yet. So, except my minor comments you're on the right way ;) Cheers!
... /example-of-a-doctrine-2-x-many-to-many-association-class/ Also you may find helpful this tutorial to start working with associations: http://knpuniversity.com/screencast/collections Have a nice day!
MolloKhan
MolloKhan
Read Full Comment
... '); } return $this->render('user/edit.html.twig', [ 'form' => $form->createView() ]); } ``` I get an error Unable to guess how to get a Doctrine instance from the request information for parameter "user". ...
Moises Cano
Moises Cano
Read Full Comment
... like "Model > User > function login()" (whitout Symfony, of course), but now, I don't sure if inside a "User entity" I can put functions like these or only Doctrine should use that Entity. Thanks you so much, I really apreciate all your help, teacher.
Juan Nicolás
Juan Nicolás
Read Full Comment
Hi Victor Thank you very much for the fast reply! Now I have this error: "Expected argument of type "Doctrine\ORM\QueryBuilder", "array" given" In my Repo I have this query: public function ...
Michael-K
Michael-K
Read Full Comment
Hey Daniel Larusso! Ah, I know the problem :). When you finish authentication, the guard authenticator calls `$user->getRoles()` on your User object. This must return an *array* of roles. But with Doctrine, a ...
weaverryan
weaverryan
Read Full Comment
... doctrine:schema:update to notice the new owner_id column. If it still doesn't work, let me know! It's also possible that you already have the owner_id column in your database, which is why Doctrine is not adding it. Check your database to be sure :). Cheers!
weaverryan
weaverryan
Read Full Comment
Hi Gremet, Oh, I see... Well, I think the article How to Generate Entities from an Existing Database could help for you. I think most cases should work with it, but anyways, if you're going to use Doctrine ORM for ...