TAG | Doctrine
Selecting something that has been created (or updated or deleted or …) between two dates is something very common I guess. So why should this be any different when you use MongoDB instead of a relational database.
And with Doctrine ODM it’s actually quite easy.
It shouldn’t be long until the first alpha version of PHP 5.4 will be released and with it there will be a lot of new features such as array dereferencing and traits to name but a few.
What does that mean to the roadmaps of Doctrine and Symfony? (more…)
I was just asked to write a small summary about the difference between a model and an entity. As I am too lazy to think up another topic for today I will just jump on that. And actually I wrote about this before as it can be quite irritating to see model folders in some bundles and entity folders in others.
So what is what?
And it has to do with the DateTime type.
I am really a fan of Doctrine 2.0 and even more so of its documentation! It explains everything you need to know and serves as a great reference. It even manages to feel more lightweight and less complex than doctrine 1.2 did.
One thing though seems to be missing from the docs: How can I do date and time arithmetics?
The answer is simple but was available to me only via IRC..
When working with Symfony2 one of the first things you notice is that in all those places where your first impulse is to look for structure there is none to find. No classes to inherit from and no particular folders to place stuff that will come to live automatically (magically).
This is true for Doctrine 2.0 as well where all your models are plain old php objects (POPOs). In fact there is no real structure. You can do pretty much everything pretty much everywhere.
But there must be some best practice to follow surely?
Yesterday way already insightful to say the least and there is a huge interest by those unable to attend as I can see from my stats.
Let’s try to gather as much presentations again!
Unfortunately I can not participate as the US of A are quite far away from mainland Europe but fortunately there is twitter and the the hastag #sflive2011 to follow what’s going on.
Here are a few highlights so far.
Just a few days ago Tomasz Ducin blogged about documenting databases with symfony and doctrine.
This feature is actually something I use for a long time and meant to blog about myself but never got round to.
While Tomasz’ post is of course still correct I decided to share my findings as well.
The symptom in my case was the result of a four left joins deep query that when scalar hydrated showed up five table rows but showed only two results when array hydrated.