Created
May 23, 2011 16:59
-
-
Save gergoerdosi/987048 to your computer and use it in GitHub Desktop.
Patch to allow setting the offset manually
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: table.php | |
--- table.php Base (BASE) | |
+++ table.php Locally Modified (Based On LOCAL) | |
@@ -83,10 +83,16 @@ | |
*/ | |
public function set( $property, $value = null ) | |
{ | |
+ if(is_object($property)) { | |
+ $property = (array) KConfig::toData($property); | |
+ } | |
+ | |
parent::set($property, $value); | |
// If limit has been changed, adjust offset accordingly | |
- if($limit = $this->_state->limit) { | |
\ No newline at end of file | |
+ if((is_array($property) && isset($property['limit']) && !isset($property['offset']) || $property == 'limit') | |
+ && $limit = $this->_state->limit) | |
+ { | |
\ No newline at end of file | |
$this->_state->offset = $limit != 0 ? (floor($this->_state->offset / $limit) * $limit) : 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment