10.04.2018 Views

Doctrine_manual-1-2-en

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 11: Native SQL 194<br />

Listing<br />

11-8<br />

// test.php<br />

// ...<br />

$users = $q->execute();<br />

echo get_class($users) . "\n";<br />

echo get_class($users[0]) . "\n";<br />

echo get_class($users[0]['Phon<strong>en</strong>umbers'][0]) . "\n";<br />

The above example would output the following wh<strong>en</strong> executed:<br />

Listing<br />

11-9<br />

$ php test.php<br />

<strong>Doctrine</strong>_Collection<br />

User<br />

Phon<strong>en</strong>umber<br />

Conclusion<br />

This chapter may or may not be useful for you right now. In most cases the <strong>Doctrine</strong> Query<br />

Language is pl<strong>en</strong>ty suffici<strong>en</strong>t for retrieving the complex data sets you require. But if you<br />

require something outside the scope of what <strong>Doctrine</strong>_Query is capable of th<strong>en</strong><br />

<strong>Doctrine</strong>_RawSql can help you.<br />

In the previous chapters you've se<strong>en</strong> a lot of m<strong>en</strong>tion about YAML schema files and have be<strong>en</strong><br />

giv<strong>en</strong> examples of schema files but hav<strong>en</strong>'t really be<strong>en</strong> trained on how to write your own. The<br />

next chapter explains in great detail how to maintain your models as YAML Schema Files<br />

(page 195).<br />

----------------- Brought to you by

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!