Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'release'

  • Loading branch information...
commit 497462846f4a9b4a4da4a1d60883fadc906fd9a4 2 parents 877367b + 35f70af
@ralphschindler ralphschindler authored
View
8 library/Zend/Db/Sql/Select.php
@@ -22,6 +22,7 @@
* @subpackage Sql
*
* @property Where $where
+ * @property Having $having
*/
class Select extends AbstractSql implements SqlInterface, PreparableSqlInterface
{
@@ -744,8 +745,6 @@ protected function processOffset(PlatformInterface $platform, Adapter $adapter =
/**
* Variable overloading
*
- * Proxies to "where" only
- *
* @param string $name
* @throws Exception\InvalidArgumentException
* @return mixed
@@ -755,6 +754,8 @@ public function __get($name)
switch (strtolower($name)) {
case 'where':
return $this->where;
+ case 'having':
+ return $this->having;
default:
throw new Exception\InvalidArgumentException('Not a valid magic property for this object');
}
@@ -769,6 +770,7 @@ public function __get($name)
*/
public function __clone()
{
- $this->where = clone $this->where;
+ $this->where = clone $this->where;
+ $this->having = clone $this->having;
}
}
View
4 tests/ZendTest/Db/Sql/SelectTest.php
@@ -416,9 +416,13 @@ public function test__clone()
$select = new Select;
$select1 = clone $select;
$select1->where('id = foo');
+ $select1->having('id = foo');
$this->assertEquals(0, $select->where->count());
$this->assertEquals(1, $select1->where->count());
+
+ $this->assertEquals(0, $select->having->count());
+ $this->assertEquals(1, $select1->having->count());
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.