I have been playing with doctrine2 + ZF installation for the past few days.
One of the things that I still cannot understand is the collection of large arrays. For example, suppose we have an object called Mail, and each message can have many comments.
<?php
class Post
{
protected $comments;
}
?>
Now this will load all comments if I do
$post->comments
But what if there are, say, 10,000 comments for this particular post? Then everything will be loaded, which is not very good. And as far as I know, fragment / pagination is not available until there is doctrine 2.1.
Can someone advise me how I can write comments? Perhaps with DQL? if DQL, where do you implement this? Do I create a getComments method in a Post object and there DQL?
Thanks bill