AsusgJob2Command.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. namespace app\models\entity;
  3. use Yii;
  4. /**
  5. * This is the model class for table "asusg_employee".
  6. *
  7. * @property int $id
  8. * @property string $asu_id
  9. * @property string $name
  10. * @property int $smopp_id
  11. */
  12. class AsusgJob2Command extends \yii\db\ActiveRecord
  13. {
  14. /**
  15. * {@inheritdoc}
  16. */
  17. public static function tableName()
  18. {
  19. return 'asusg_job2command';
  20. }
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public function rules()
  25. {
  26. return [
  27. [['smopp_cmd_id','asusg_job_id'], 'required'],
  28. [['smopp_cmd_id','asusg_job_id'], 'integer'],
  29. //[['asu_id'], 'string', 'max' => 45],
  30. //[['name'], 'string', 'max' => 255],
  31. ];
  32. }
  33. /**
  34. * {@inheritdoc}
  35. */
  36. public function attributeLabels()
  37. {
  38. return [
  39. 'asusg_job_id' => 'Asu ID',
  40. 'cmd_order' => 'Порядковый номер',
  41. 'smopp_cmd_id' => 'Smopp ID',
  42. ];
  43. }
  44. public function getTasktypes()
  45. {
  46. return $this->hasOne(Tasktypes::className(), ['id' => 'smopp_cmd_id']);
  47. }
  48. public function getJobplan()
  49. {
  50. return $this->hasOne(AsusgJobplan::className(), ['id' => 'asusg_job_id']);
  51. }
  52. public function getAsusgJob2Launch()
  53. {
  54. return $this->hasOne(AsusgJob2Launch::className(), ['id' => 'smopp_cmd_id']);
  55. }
  56. public function getJobplantie()
  57. {
  58. return $this->hasOne(AsusgJob2Launch::className(), ['asusg_jobplan_id' => 'asusg_job_id']);
  59. }
  60. }