private function loadModel($id) { if (!$id) { throw new CException("Outer Link id must be passed"); } $model = OuterLink::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }