CakePHP hasOne ineffeciency?

Posted by Andre on Stack Overflow See other posts from Stack Overflow or by Andre
Published on 2010-04-26T19:14:36Z Indexed on 2010/04/26 20:13 UTC
Read the original article Hit count: 206

Filed under:
|

I was looking at examples on the CakePHP website, in particular hasOne used in linking models. http://book.cakephp.org/view/78/Associations-Linking-Models-Together

My question is this, is CakePHP using two queries to build the array structure of data returned in a model that uses hasOne linkage?

Taken from CakePHP: //Sample results from a $this->User->find() call.

Array
(
    [User] => Array
        (
            [id] => 121
            [name] => Gwoo the Kungwoo
            [created] => 2007-05-01 10:31:01
        )
    [Profile] => Array
        (
            [id] => 12
            [user_id] => 121
            [skill] => Baking Cakes
            [created] => 2007-05-01 10:31:01
        )
)

Hope this all makes sense.

© Stack Overflow or respective owner

Related posts about cakephp

Related posts about php