Created
May 20, 2010 16:43
-
-
Save kriswallsmith/407785 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Query extends Doctrine_Query | |
{ | |
protected | |
$_disableLimitSubquery = false; | |
/** | |
* Disables the limit subquery for the current query object. | |
*/ | |
public function disableLimitSubquery() | |
{ | |
$this->_disableLimitSubquery = true; | |
return $this; | |
} | |
public function createSubquery() | |
{ | |
$query = parent::createSubquery(); | |
if ($this->_disableLimitSubquery) | |
{ | |
$query->disableLimitSubquery(); | |
} | |
return $query; | |
} | |
public function buildSqlQuery($limitSubquery = true) | |
{ | |
if ($this->_disableLimitSubquery) | |
{ | |
$limitSubquery = false; | |
} | |
return parent::buildSqlQuery($limitSubquery); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment