/**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Manuscript();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Manuscript'])) {
         $model->attributes = $_POST['Manuscript'];
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->id));
         }
     }
     $this->render('create', array('model' => $model));
 }
Пример #2
0
 private function createManuScript($dataset_id, $doi, $pmid)
 {
     if (empty($doi) && empty($pmid)) {
         return;
     }
     $manuscript = new Manuscript();
     if (!empty($doi)) {
         $manuscript->identifier = $doi;
     } else {
         $manuscript->identifier = " ";
     }
     if (!empty($pmid)) {
         $manuscript->pmid = $pmid;
     }
     $manuscript->dataset_id = $dataset_id;
     $manuscript->save(false);
 }