AsusgJob2Launch.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace app\models\entity;
  3. use Yii;
  4. /**
  5. * This is the model class for table "asusg_jobplan".
  6. *
  7. * @property int $id
  8. * @property string $name
  9. * @property int $smopp_jt_id
  10. * @property int $asusg_id
  11. */
  12. class AsusgJob2Launch extends \yii\db\ActiveRecord
  13. {
  14. /**
  15. * {@inheritdoc}
  16. */
  17. public static function tableName()
  18. {
  19. return 'asusg_job2launch';
  20. }
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public function rules()
  25. {
  26. return [
  27. [['asusg_project_id','asusg_jobplan_id','job_order'], 'required'],
  28. [['asusg_job_uuid'], 'unique'],
  29. [['asusg_job_uuid', 'employees_uuid'], 'unique', 'targetAttribute' => ['asusg_job_uuid', 'employees_uuid']],
  30. ];
  31. }
  32. public function getAsusgJobplan()
  33. {
  34. return $this->hasOne(AsusgJobplan::className(), ['id' => 'asusg_jobplan_id']);
  35. }
  36. /*
  37. public function getAsusgJobplan()
  38. {
  39. return $this->hasOne(AsusgJobplan::className(), ['id' => 'asusg_jobplan_id']);
  40. }*/
  41. public function getAsusgProject()
  42. {
  43. return $this->hasOne(AsusgProject::className(), ['id' => 'asusg_project_id']);
  44. }
  45. public function getTasks()
  46. {
  47. return $this->hasOne(Tasks::className(), ['asusg_job_mapped_id' => 'id']);
  48. }
  49. }