kla/php-activerecord — pull request #226 by sblackstone (2012-08-10 16:37:07+00:00)
Title: Allow use of SQL_CALC_FOUND_ROWS for MySQL as a finder option.

SQL_CALC_FOUND_ROWS is really a necessary evil if your doing pagination on a MySQL server.. The alternative is to do it with double queries for everything which is really not efficient..

This allows the following:

list ($count, $rows) = SomeModel::find('all', array('mysql_calc_found_rows' => true);

The reason you can't just do this with putting the value in the SELECT field is that if you do any includes, by the time you get control again to do a query for FOUND_ROWS(), it will be overwritten by the value from the include query.