CC-5709: Airtime Analyzer

* Fixed the /rest/media endpoint
This commit is contained in:
Albert Santoni 2014-03-06 17:38:57 -05:00
parent 4e39fce701
commit c0818682af
1 changed files with 14 additions and 1 deletions

View File

@ -12,9 +12,22 @@ class Rest_MediaController extends Zend_Rest_Controller
if (!$this->verifyApiKey()) {
return;
}
$files_array = [];
foreach (CcFilesQuery::create()->find() as $file)
{
array_push($files_array, $file->toArray(BasePeer::TYPE_FIELDNAME));
}
$this->getResponse()
->setHttpResponseCode(200)
->appendBody(json_encode($files_array));
/** TODO: Use this simpler code instead after we upgrade to Propel 1.7 (Airtime 2.6.x branch):
$this->getResponse()
->setHttpResponseCode(200)
->appendBody(json_encode(CcFilesQuery::create()->find()->toArray(/*BasePeer::TYPE_FIELDNAME*/)));
->appendBody(json_encode(CcFilesQuery::create()->find()->toArray(BasePeer::TYPE_FIELDNAME)));
*/
}
public function getAction()