Lazy-connecting to database is handled via Doctrine_Db wrapper. When using Doctrine_Db instead of PDO / Doctrine_Adapter, lazy-connecting
to database is being performed (that means Doctrine will only connect to database when needed). <br\><br\>This feature can be very useful
when using for example page caching, hence not actually needing a database connection on every request. Remember connecting to database is an expensive operation.
<br\><br\>
<?php
renderCode("<?php
// we may use PDO / PEAR like DSN
// here we use PEAR like DSN
\$dbh = new Doctrine_Db('mysql://username:password@localhost/test');
@@ -21,7 +21,7 @@ SELECT u.*, p.* FROM User u, u.Phonenumber p
</pre>
</div>
<li \><i>INNER JOIN</i> produces a Cartesian product between two specified components (that is, each and every record in the first component is joined to each and every record in the second component).
<li \><i>INNER JOIN</i> produces an intersection between two specified components (that is, each and every record in the first component is joined to each and every record in the second component).
So basically <i>INNER JOIN</i> can be used when you want to efficiently fetch for example all users which have one or more phonenumbers.