|
|
@@ -43,7 +43,9 @@ class Produit extends \yii\db\ActiveRecord |
|
|
|
[['prix', 'poids'], 'number'], |
|
|
|
[['illustration','photo'], 'file'], |
|
|
|
[['nom', 'description', 'illustration', 'photo', 'saison','diminutif'], 'string', 'max' => 255], |
|
|
|
[['recette'], 'string','max'=>1000] |
|
|
|
[['recette'], 'string','max'=>1000], |
|
|
|
['id_boulangerie','integer'], |
|
|
|
['id_boulangerie','required'], |
|
|
|
]; |
|
|
|
} |
|
|
|
|
|
|
@@ -95,4 +97,10 @@ class Produit extends \yii\db\ActiveRecord |
|
|
|
else |
|
|
|
return $this->description ; |
|
|
|
} |
|
|
|
|
|
|
|
public function save($runValidation = true, $attributeNames = NULL) |
|
|
|
{ |
|
|
|
$this->id_boulangerie = Yii::$app->user->identity->id ; |
|
|
|
return parent::save($runValidation, $attributeNames) ; |
|
|
|
} |
|
|
|
} |