/** * Creates the filename for this video path and format * * @param FieldValues $values * @param string $format * @return string */ protected function filename($values, $format) { $filepath = $values->original; $audioChannels = $values->audio_channels(2); $audioBitDepth = $values->audio_bit_depth(16); $info = $this->MediaPaths->isUrlPath($filepath) ? $this->MediaPaths->fileVersionInfoFromUrl($filepath) : $this->MediaPaths->fileVersionInfo($filepath); return $this->MediaPaths->makeRelativePath("{$info->versiondir}/{$info->filename}_{$audioChannels}_{$audioBitDepth}.{$format}"); }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return FieldValues the loaded model * @throws CHttpException */ public function loadModel($id) { $model = FieldValues::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }