/** * Method for deleting media assigned to this */ public function actionDelmedia($id) { $model = TuberPhoto::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } $model->delete(); }