|
|
|
|
|
|
|
|
* @property integer $id_produit |
|
|
* @property integer $id_produit |
|
|
* @property double $quantite |
|
|
* @property double $quantite |
|
|
*/ |
|
|
*/ |
|
|
class CommandeProduit extends \yii\db\ActiveRecord { |
|
|
|
|
|
|
|
|
class CommandeProduit extends \yii\db\ActiveRecord |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @inheritdoc |
|
|
* @inheritdoc |
|
|
*/ |
|
|
*/ |
|
|
public static function tableName() { |
|
|
|
|
|
|
|
|
public static function tableName() |
|
|
|
|
|
{ |
|
|
return 'commande_produit'; |
|
|
return 'commande_produit'; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* Relations |
|
|
* Relations |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
public function getProduit() { |
|
|
|
|
|
|
|
|
public function getProduit() |
|
|
|
|
|
{ |
|
|
return $this->hasOne(Produit::className(), ['id' => 'id_produit']); |
|
|
return $this->hasOne(Produit::className(), ['id' => 'id_produit']); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @inheritdoc |
|
|
* @inheritdoc |
|
|
*/ |
|
|
*/ |
|
|
public function rules() { |
|
|
|
|
|
|
|
|
public function rules() |
|
|
|
|
|
{ |
|
|
return [ |
|
|
return [ |
|
|
[['id_commande', 'id_produit', 'quantite'], 'required'], |
|
|
[['id_commande', 'id_produit', 'quantite'], 'required'], |
|
|
[['id_commande', 'id_produit'], 'integer'], |
|
|
[['id_commande', 'id_produit'], 'integer'], |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @inheritdoc |
|
|
* @inheritdoc |
|
|
*/ |
|
|
*/ |
|
|
public function attributeLabels() { |
|
|
|
|
|
|
|
|
public function attributeLabels() |
|
|
|
|
|
{ |
|
|
return [ |
|
|
return [ |
|
|
'id' => 'ID', |
|
|
'id' => 'ID', |
|
|
'id_commande' => 'Id Commande', |
|
|
'id_commande' => 'Id Commande', |
|
|
|
|
|
|
|
|
]; |
|
|
]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |