You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CommandeProduit.php 1.1KB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace common\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "commande_produit".
  6. *
  7. * @property integer $id
  8. * @property integer $id_commande
  9. * @property integer $id_produit
  10. * @property double $quantite
  11. */
  12. class CommandeProduit extends \yii\db\ActiveRecord {
  13. /**
  14. * @inheritdoc
  15. */
  16. public static function tableName() {
  17. return 'commande_produit';
  18. }
  19. /*
  20. * Relations
  21. */
  22. public function getProduit() {
  23. return $this->hasOne(Produit::className(), ['id' => 'id_produit']);
  24. }
  25. /**
  26. * @inheritdoc
  27. */
  28. public function rules() {
  29. return [
  30. [['id_commande', 'id_produit', 'quantite'], 'required'],
  31. [['id_commande', 'id_produit'], 'integer'],
  32. [['quantite'], 'number', 'min' => 0]
  33. ];
  34. }
  35. /**
  36. * @inheritdoc
  37. */
  38. public function attributeLabels() {
  39. return [
  40. 'id' => 'ID',
  41. 'id_commande' => 'Id Commande',
  42. 'id_produit' => 'Id Produit',
  43. 'quantite' => 'Quantite',
  44. ];
  45. }
  46. }