fixed the total count being passed and undid previous commit
This commit is contained in:
parent
895e0a90de
commit
59df8ca6f8
2 changed files with 5 additions and 2 deletions
|
@ -37,6 +37,7 @@ class Rest_PodcastController extends Zend_Rest_Controller
|
|||
$result = PodcastQuery::create()
|
||||
// Don't return the Station podcast - we fetch it separately
|
||||
->filterByDbId($stationPodcastId, Criteria::NOT_EQUAL);
|
||||
$total = $result->count();
|
||||
if ($limit > 0) { $result->setLimit($limit); }
|
||||
$result->setOffset($offset)
|
||||
->orderBy($sortColumn, $sortDir);
|
||||
|
@ -44,9 +45,10 @@ class Rest_PodcastController extends Zend_Rest_Controller
|
|||
|
||||
$podcastArray = $result->toArray(null, false, BasePeer::TYPE_FIELDNAME);
|
||||
|
||||
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(200)
|
||||
->setHeader('X-TOTAL-COUNT', $result->count())
|
||||
->setHeader('X-TOTAL-COUNT', $total)
|
||||
->appendBody(json_encode($podcastArray));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue