/**
  * Creates a new Equipment model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Equipment();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }
 /**
  * Creates a new Equipment model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Equipment();
     $model->available = true;
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         //Las siguientes líneas de código almacenan en la tabla Log información de acerca de las altas de equipos
         $modelLog = new Log();
         $modelLog->user_id = Yii::$app->user->id;
         $modelLog->date = new \yii\db\Expression('NOW()');
         $modelLog->log_type_id = 1;
         $modelLog->equipment_id = $model->id;
         $modelLog->location_id = $model->location_id;
         $modelLog->equipment_status_id = $model->equipment_status_id;
         $modelLog->save();
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }