Companies.php 908 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace app\models\entity;
  3. use Yii;
  4. use yii\db\ActiveRecord;
  5. /**
  6. * @property int $id [int(11)]
  7. * @property string $name [varchar(255)]
  8. * @property string $ceo [varchar(255)]
  9. * @property string $address [varchar(255)]
  10. * @property string $active [bit(1)]
  11. * @property string $logo [varchar(255)]
  12. * @property string $last_assign [datetime]
  13. * @property string $last_invalid_tasks_check [datetime]
  14. * @property int $confirm_default_timeout_seconds [int(11)]
  15. */
  16. class Companies extends ActiveRecord
  17. {
  18. /**
  19. * @return string название таблицы, сопоставленной с этим ActiveRecord-классом.
  20. */
  21. public static function tableName()
  22. {
  23. return '{{companies}}';
  24. }
  25. public function getAccounts()
  26. {
  27. return $this->hasMany(Accounts::className(), ['company_id' => 'id']);
  28. }
  29. }