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.

пре 8 година
пре 8 година
пре 8 година
пре 8 година
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. namespace common\models;
  3. use Yii;
  4. use common\models\Commande ;
  5. /**
  6. * This is the model class for table "production".
  7. *
  8. * @property integer $id
  9. * @property string $date
  10. * @property integer $actif
  11. */
  12. class Production extends \yii\db\ActiveRecord
  13. {
  14. /**
  15. * @inheritdoc
  16. */
  17. public static function tableName()
  18. {
  19. return 'production';
  20. }
  21. public function getEtablissement() {
  22. return $this->hasOne(Etablissement::className(), ['id'=>'id_etablissement']) ;
  23. }
  24. /**
  25. * @inheritdoc
  26. */
  27. public function rules()
  28. {
  29. return [
  30. [['date'], 'required'],
  31. [['date'], 'safe'],
  32. [['actif'], 'integer']
  33. ];
  34. }
  35. /**
  36. * @inheritdoc
  37. */
  38. public function attributeLabels()
  39. {
  40. return [
  41. 'id' => 'ID',
  42. 'date' => 'Date',
  43. 'actif' => 'Actif',
  44. ];
  45. }
  46. public function getCommande()
  47. {
  48. return $this->hasMany(Commande::className(), ['id_production' => 'id']) ;
  49. }
  50. }