Ejemplo n.º 1
0
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new UserSpecialistProfile();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['UserSpecialistProfile'])) {
         $model->attributes = $_POST['UserSpecialistProfile'];
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->id));
         }
     }
     $this->render('create', array('model' => $model));
 }
Ejemplo n.º 2
0
 /**
 * This method Accepts user ID and array of data from user.
 * creates the model.
 * returns model.
 * * Data array should have following hash keys
 *   	1. specialist type id
 2.	company name
 3.	contact person name
 4. company description
 5. address
 6. country id
 7. state id
 8. city id
 9. mobile no.
 10.Telephone no.
 11.email id
 12.image
 
 *
 * @param int userId,array data.
 * @return model
 */
 public static function createSpecialistProfile($userId, $data)
 {
     $specialist = new UserSpecialistProfile();
     $specialist->user_id = $userId;
     $specialist->attributes = $data;
     $specialist->save();
     return $specialist;
 }