pmtpenza

Untitled

Jul 16th, 2019
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. <?php
  2.  
  3. use Yii;
  4. namespace backend\models;
  5. use backend\models\TypeZakaz;
  6.  
  7.  
  8. /**
  9. * This is the model class for table "order".
  10. *
  11. * @property int $id
  12. * @property int $tasks_id
  13. * @property int $type_zakaz_id
  14. */
  15. class Order extends \yii\db\ActiveRecord
  16. {
  17. public function getDeals(){
  18. return $this->hasOne(Deals::className(), ['id' => 'deals_id']);
  19. }
  20. public function getType(){
  21. return $this->hasOne(TypeZakaz::className(), ['id' => 'type_zakaz_id']);
  22. }
  23. /**
  24. * {@inheritdoc}
  25. */
  26. public static function tableName()
  27. {
  28. return 'order';
  29. }
  30.  
  31. /**
  32. * {@inheritdoc}
  33. */
  34. public function rules()
  35. {
  36. return [
  37. [['deals_id', 'type_zakaz_id'], 'integer'],
  38. ];
  39. }
  40.  
  41. /**
  42. * {@inheritdoc}
  43. */
  44. public function attributeLabels()
  45. {
  46. return [
  47. 'id' => 'ID',
  48. 'deals_id' => 'deals ID',
  49. 'type_zakaz_id' => 'Type Zakaz ID',
  50. ];
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment