Changeset 3554

Show
Ignore:
Timestamp:
01/19/08 17:22:47 (18 months ago)
Author:
tigglet
Message:

Added Doctrine::HYDRATE_NONE example to "Fetch Only What You Need" subchapter of the "Improving performanc" chapter.

Location:
branches
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/0.10/manual/docs/en/improving-performance/fetch-only-what-you-need.txt

    r1796 r3554  
    5151} 
    5252</code> **Array fetching is the best choice whenever you need data read-only like passing it to the view for display. And from my experience, most of the time when you fetch a large amount of data it's only for display purposes. And these are exactly the cases where you get the best performance payoff when fetching arrays instead of objects.** 
     53 
     54Sometimes, you may want the direct output from PDO instead of an object or an array.  To do this, set the hydration mode to **Doctrine::HYDRATE_NONE**.  Here's an example: 
     55<code type="php"> 
     56$total = Doctrine_Query::create() 
     57  ->select('SUM(d.amount)') 
     58  ->from('Donation d') 
     59  ->execute(array(), Doctrine::HYDRATE_NONE); 
     60</code> 
  • branches/0.9/manual/docs/en/improving-performance/fetch-only-what-you-need.txt

    r1796 r3554  
    5151} 
    5252</code> **Array fetching is the best choice whenever you need data read-only like passing it to the view for display. And from my experience, most of the time when you fetch a large amount of data it's only for display purposes. And these are exactly the cases where you get the best performance payoff when fetching arrays instead of objects.** 
     53 
     54Sometimes, you may want the direct output from PDO instead of an object or an array.  To do this, set the hydration mode to **Doctrine::HYDRATE_NONE**.  Here's an example: 
     55<code type="php"> 
     56$total = Doctrine_Query::create() 
     57  ->select('SUM(d.amount)') 
     58  ->from('Donation d') 
     59  ->execute(array(), Doctrine::HYDRATE_NONE); 
     60</code>