|
|
@@ -49,7 +49,8 @@ use common\helpers\Mail ; |
|
|
|
/** |
|
|
|
* ContactForm is the model behind the contact form. |
|
|
|
*/ |
|
|
|
class CreditForm extends Model { |
|
|
|
class CreditForm extends Model |
|
|
|
{ |
|
|
|
|
|
|
|
public $id_user ; |
|
|
|
public $id_user_action ; |
|
|
@@ -63,7 +64,8 @@ class CreditForm extends Model { |
|
|
|
/** |
|
|
|
* @inheritdoc |
|
|
|
*/ |
|
|
|
public function rules() { |
|
|
|
public function rules() |
|
|
|
{ |
|
|
|
return [ |
|
|
|
[['montant'], 'required'], |
|
|
|
[['id_user', 'id_user_action', 'id_etablissement'], 'integer'], |
|
|
@@ -76,7 +78,8 @@ class CreditForm extends Model { |
|
|
|
/** |
|
|
|
* @inheritdoc |
|
|
|
*/ |
|
|
|
public function attributeLabels() { |
|
|
|
public function attributeLabels() |
|
|
|
{ |
|
|
|
return [ |
|
|
|
'id_user' => 'Utilisateur', |
|
|
|
'id_user_action' => 'Utilisateur', |
|
|
@@ -90,7 +93,11 @@ class CreditForm extends Model { |
|
|
|
]; |
|
|
|
} |
|
|
|
|
|
|
|
public function save() { |
|
|
|
/** |
|
|
|
* Enregistre un modèle CreditHistorique. |
|
|
|
*/ |
|
|
|
public function save() |
|
|
|
{ |
|
|
|
if ($this->validate()) { |
|
|
|
$credit_historique = new CreditHistorique ; |
|
|
|
$credit_historique->id_user = $this->id_user; |
|
|
@@ -115,7 +122,6 @@ class CreditForm extends Model { |
|
|
|
'credit_form' => $this |
|
|
|
]) ; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|