Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Reset the Order part when resetting Select #2731

Merged
merged 1 commit into from

2 participants

@robertbasic

The Order part of the Select object was not getting reset.
Test added.

Fixes #2730

@robertbasic robertbasic Reset the Order part when resetting Select
The Order part of the Select object was not getting reset.
Test added.

Fixes #2730
3431270
@ralphschindler ralphschindler merged commit 3431270 into zendframework:master

1 check passed

Details default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 10, 2012
  1. @robertbasic

    Reset the Order part when resetting Select

    robertbasic authored
    The Order part of the Select object was not getting reset.
    Test added.
    
    Fixes #2730
This page is out of date. Refresh to see the latest.
View
3  library/Zend/Db/Sql/Select.php
@@ -408,6 +408,9 @@ public function reset($part)
case self::OFFSET:
$this->offset = null;
break;
+ case self::ORDER:
+ $this->order = null;
+ break;
}
return $this;
}
View
5 tests/ZendTest/Db/Sql/SelectTest.php
@@ -371,6 +371,11 @@ public function testReset()
$select->reset(Select::OFFSET);
$this->assertNull($select->getRawState(Select::OFFSET));
+ // order
+ $select->order('foo asc');
+ $this->assertEquals(array('foo asc'), $select->getRawState(Select::ORDER));
+ $select->reset(Select::ORDER);
+ $this->assertNull($select->getRawState(Select::ORDER));
}
/**
Something went wrong with that request. Please try again.