Skip to content

Commit

Permalink
added chaining 'limit'
Browse files Browse the repository at this point in the history
  • Loading branch information
mjpearson committed Apr 4, 2010
1 parent f3e47fd commit 9dbf88b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
3 changes: 1 addition & 2 deletions examples/uuid_columnfamily.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
$ks,
$cfName,
PandraColumnFamily::TYPE_UUID);
$cfNew->setLimit(5);
$cfNew->load();
$cfNew->limit(5)->load();
echo '<br>Loaded...<br>';
print_r($cfNew->toJSON());

Expand Down
3 changes: 1 addition & 2 deletions examples/uuid_supercolumn.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
$scNew = new PandraSuperColumn($superName, $keyID, $ks, NULL, PandraColumnContainer::TYPE_UUID);
$scNew->setColumnFamilyName($cfName);

$scNew->setLimit(5);
$scNew->load();
$scNew->limit(5)->load();
echo '<br>Loaded...<br>';
print_r($scNew->toJSON());

Expand Down
3 changes: 1 addition & 2 deletions examples/uuid_supercolumnfamily.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ function rand_str($length = 32, $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijkl
echo '<br><br>Loading via SuperColumnFamily container...<br>';
$scNew = new PandraSuperColumnFamily($keyID, $ks, $cfName, PandraColumnContainer::TYPE_UUID);

$scNew->setLimit(5);
$scNew->load();
$scNew->limit(5)->load();

echo '<br>Loaded...<br>';
print_r($scNew->toJSON());
Expand Down
5 changes: 5 additions & 0 deletions lib/ColumnContainer.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,11 @@ public function setLimit($limit) {
$this->_rangeLimit = $limit;
}

public function limit($limit) {
$this->setLimit($limit);
return $this;
}

public function getLimit() {
return $this->_rangeLimit;
}
Expand Down

0 comments on commit 9dbf88b

Please sign in to comment.