From 1d0330945f9be6494c81687c2db16a983c63026d Mon Sep 17 00:00:00 2001 From: zYne Date: Tue, 15 May 2007 23:08:03 +0000 Subject: [PATCH] added distint() and forUpdate() --- draft/new-core/Query.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/draft/new-core/Query.php b/draft/new-core/Query.php index 5bdd56097..101329653 100644 --- a/draft/new-core/Query.php +++ b/draft/new-core/Query.php @@ -1122,6 +1122,33 @@ class Doctrine_Query2 extends Doctrine_Hydrate2 implements Countable { return $this->getParser('select')->parse($select); } + /** + * distinct + * Makes the query SELECT DISTINCT. + * + * @param bool $flag Whether or not the SELECT is DISTINCT (default true). + * @return Doctrine_Query + */ + public function distinct($flag = true) + { + $this->_parts['distinct'] = (bool) $flag; + + return $this; + } + + /** + * forUpdate + * Makes the query SELECT FOR UPDATE. + * + * @param bool $flag Whether or not the SELECT is FOR UPDATE (default true). + * @return Doctrine_Query + */ + public function forUpdate($flag = true) + { + $this->_parts[self::FOR_UPDATE] = (bool) $flag; + + return $this; + } /** * delete * sets the query type to DELETE