Index: trunk/extensions/Storyboard/api/ApiQueryStories.php |
— | — | @@ -61,8 +61,15 @@ |
62 | 62 | $this->addOption( 'ORDER BY', 'story_modified DESC' ); |
63 | 63 | |
64 | 64 | $stories = $this->select( __METHOD__ ); |
| 65 | + $count = 0; |
65 | 66 | |
66 | 67 | while ( $story = $stories->fetchObject() ) { |
| 68 | + if ( ++$count > $params['limit'] ) { |
| 69 | + // We've reached the one extra which shows that |
| 70 | + // there are additional pages to be had. Stop here... |
| 71 | + $this->setContinueEnumParameter( 'continue', "" ); // TODO: add some weird stuff here |
| 72 | + break; |
| 73 | + } |
67 | 74 | $res = array( |
68 | 75 | 'id' => $story->story_id, |
69 | 76 | 'author' => $story->story_author_name, |
— | — | @@ -99,8 +106,8 @@ |
100 | 107 | */ |
101 | 108 | public function getParamDescription() { |
102 | 109 | return array ( |
103 | | - 'offset' => 'Number of the first story to return', |
104 | | - 'size' => 'Amount of stories to return', |
| 110 | + 'continue' => 'Number of the first story to return', |
| 111 | + 'limit' => 'Amount of stories to return', |
105 | 112 | ); |
106 | 113 | } |
107 | 114 | |