From b28af2e5278013eaf508a69127676e2690337e3d Mon Sep 17 00:00:00 2001 From: docteurklein Date: Tue, 27 Sep 2011 10:36:32 +0200 Subject: [PATCH] added fluent pattern to Query\Expr\Base::add* methods --- lib/Doctrine/ORM/Query/Expr/Base.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/Doctrine/ORM/Query/Expr/Base.php b/lib/Doctrine/ORM/Query/Expr/Base.php index abe7e54be..abc2c210e 100644 --- a/lib/Doctrine/ORM/Query/Expr/Base.php +++ b/lib/Doctrine/ORM/Query/Expr/Base.php @@ -45,12 +45,14 @@ abstract class Base { $this->addMultiple($args); } - + public function addMultiple($args = array()) { foreach ((array) $args as $arg) { $this->add($arg); } + + return $this; } public function add($arg) @@ -67,6 +69,8 @@ abstract class Base $this->_parts[] = $arg; } + + return $this; } public function count() @@ -79,7 +83,7 @@ abstract class Base if ($this->count() == 1) { return (string) $this->_parts[0]; } - + return $this->_preSeparator . implode($this->_separator, $this->_parts) . $this->_postSeparator; } -} \ No newline at end of file +}