Merge branch 'cc-5709-airtime-analyzer' of github.com:sourcefabric/Airtime into cc-5709-airtime-analyzer

Conflicts:
	airtime_mvc/application/Bootstrap.php
	airtime_mvc/application/controllers/plugins/Acl_plugin.php
This commit is contained in:
drigato 2014-08-28 12:01:42 -04:00
commit 52f3ed816e
12 changed files with 418 additions and 1277 deletions

View file

@ -13,6 +13,14 @@
*/
class CcFiles extends BaseCcFiles {
//fields we should never expose through our RESTful API
private static $privateFields = array(
'file_exists',
'silan_check',
'is_scheduled',
'is_playlist'
);
public function getCueLength()
{
$cuein = $this->getDbCuein();
@ -46,4 +54,20 @@ class CcFiles extends BaseCcFiles {
$this->save();
}
/**
*
* Strips out the private fields we do not want to send back in API responses
* @param $file a CcFiles object
*/
//TODO: rename this function?
public static function sanitizeResponse($file)
{
$response = $file->toArray(BasePeer::TYPE_FIELDNAME);
foreach (self::$privateFields as $key) {
unset($response[$key]);
}
return $response;
}
} // CcFiles