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!
... ');
}
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". ...
... 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.
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 ...
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 ...
... 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!
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 ...
... and I check the Ajax request, and then the form (symphony debug toolbar), the input file is empty, so I guess that's probably why vich doctrine listener doesn't work. If you code or anything else tell me
And everything works fine without using Ajax.
Yo bblue
Great question! The answer is, yes! Well, actually, the answer is: "it depends", but in this case yes. So, the Doctrine library exposes some classes that help read annotations. If you use them directly, it's ...
... bundle name always works.
Btw, if you're curious, here is the file Symfony looks for to load the configuration tree: https://github.com/doctrine/DoctrineCacheBundle/blob/master/DependencyInjection/Configuration.php
Cheers!
... have a course about internationalization? How to translate my hard coded stuff (like headers), my form labels, my Doctrine fields but also my settings on the site like date format and thousand seperator?
The docs are ...
... you didn't teach how to build a login with a connection of database?
what about this
Assetic
Bundles
Console
Databases (Doctrine ORM)
Debug
Deployment
Email
Event Dispatcher
Expressions
Forms
Front-end
HTTP Cache ...
Yo Mike!
Hmm, is your @ORM\Column a type="date" or type="datetime"? If it's "date", change it to "datetime": our form is correctly submitting a DateTime with time, but then Doctrine is saving only the date part.
I'm ...
Yo Max!
This is a good find, and a pretty common - sometimes annoying "feature" in Doctrine. By default, all relationships have ON DELETE RESTRICT in the database: if you try to delete a User, but it is the "owner" of ...
Do you need getters and setters for Doctrine/Symfony to work? Or can you just make the Entity properties public?
Also... along the same lines... why even use getters and setters? I've read that its so that you can ...
... *love* the way you said:
> the query already knows to select from the GENUS Entity's table
The "weird" (by design) thing about Doctrine sometimes is that it wants you to think in terms of entities and not worry about the database. So, your way of thinking about it here is perfect.
Cheers!
... --dev hautelook/alice-bundle doctrine/data-fixtures
2) activate it in the AppKernel:
$bundles[] = new Hautelook\AliceBundle\HautelookAliceBundle();
3) create an yml file in the src/AppBundle/DataFixtures/ORM folder (we ...
... //knpuniversity.com/screencast/symfony2-ep2/plain-password, that will now clear the password field as well. This means that when your user is persisted in the session, and you flush the Doctrine entity manager, it will ...
2709
Doctrine
Filter Results