How to get nested array from MySQL select with joins
===

I have the models User, Post, Comment and Tag.

 - User creates Post.
 - Posts can have multiple Comment and Tag.

I want to get a nested array like below, using a single MySQL query.

 - **Which MySQL query should I run?**
 - **I suppose I need to alter the result with PHP to get my nested array. How?**

Thanks a lot for your help :-)

        [0] => Array
        (
            [Post] => Array
                (
                    [id] => 1
                    [title] => First article
                    [content] => aaa
                    [created] => 2008-05-18 00:00:00
                )
            [Comment] => Array
                (
                    [0] => Array
                        (
                            [id] => 1
                            [post_id] => 1
                            [author] => Daniel
                            [email] => dan@example.com
                            [website] => http://example.com
                            [comment] => First comment
                            [created] => 2008-05-18 00:00:00
                        )
                    [1] => Array
                        (
                            [id] => 2
                            [post_id] => 1
                            [author] => Sam
                            [email] => sam@example.net
                            [website] => http://example.net
                            [comment] => Second comment
                            [created] => 2008-05-18 00:00:00
                        )
                )
            [Tag] => Array
                (
                    [0] => Array
                        (
                            [id] => 1
                            [name] => Awesome
                        )
                    [1] => Array
                        (
                            [id] => 2
                            [name] => Baking
                        )
                )
        )
        [1] => Array
        (
            [Post] => Array
                (...