Skip to content

Instantly share code, notes, and snippets.

@kriswallsmith
Created May 20, 2010 16:43
Show Gist options
  • Save kriswallsmith/407785 to your computer and use it in GitHub Desktop.
Save kriswallsmith/407785 to your computer and use it in GitHub Desktop.
<?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