/**
  * Deletes an existing Sales model.
  * If deletion is successful, the browser will be redirected to the 'index' page.
  * @param integer $id
  * @return mixed
  */
 public function actionDelete($id)
 {
     $model = $this->findModel($id);
     $api = new ApiSales(['modelClass' => Sales::className()]);
     $api->delete($id, $model);
     return $this->redirect(['index']);
 }
Beispiel #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getSales()
 {
     return $this->hasOne(Sales::className(), ['id' => 'sales_id']);
 }