/** * Finds the NotaVenta model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return NotaVenta the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = NotaVenta::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * @return \yii\db\ActiveQuery */ public function getNotaVentas() { return $this->hasMany(NotaVenta::className(), ['id_cliente' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getIdNotaVenta() { return $this->hasOne(NotaVenta::className(), ['id' => 'id_nota_venta']); }
/** * @return \yii\db\ActiveQuery */ public function getNotaVentas() { return $this->hasMany(NotaVenta::className(), ['id_empleado' => 'Id']); }