Reduce the number of additional Queries to 0 by overriding functions in the base model

Posted by user334017 on Stack Overflow See other posts from Stack Overflow or by user334017
Published on 2010-05-06T18:43:41Z Indexed on 2010/05/06 18:48 UTC
Read the original article Hit count: 155

Filed under:

my basic database setup is:

User:...  
Info:  
  relations:  
    User: { foreignType:one }

When displaying information on the user it takes: 1 query to find info on the user, and 1 query to find additional info

I want to reduce this to one query that finds both, I assume I need to override a function from BaseUser.class.php, or something along those lines but I'm not really sure what to do.

Thanks!

© Stack Overflow or respective owner

Related posts about symfony