Locations.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace app\models\entity;
  3. use Yii;
  4. /**
  5. * This is the model class for table "locations".
  6. *
  7. * @property int $id
  8. * @property string $name
  9. * @property string $description
  10. * @property int $x
  11. * @property int $y
  12. * @property int $company_id
  13. * @property string $type
  14. */
  15. class Locations extends \yii\db\ActiveRecord
  16. {
  17. /**
  18. * {@inheritdoc}
  19. */
  20. public static function tableName()
  21. {
  22. return 'locations';
  23. }
  24. /**
  25. * {@inheritdoc}
  26. */
  27. public function rules()
  28. {
  29. return [
  30. [['name'], 'required'],
  31. [['x', 'y', 'company_id'], 'integer'],
  32. [['name', 'description'], 'string', 'max' => 255],
  33. [['img'], 'safe'],
  34. [['type'], 'string', 'max' => 15],
  35. ];
  36. }
  37. /**
  38. * {@inheritdoc}
  39. */
  40. public function attributeLabels()
  41. {
  42. return [
  43. 'id' => 'ID',
  44. 'name' => 'ID датчика',
  45. 'description' => 'Описание',
  46. 'x' => 'X',
  47. 'y' => 'Y',
  48. 'company_id' => 'Company ID',
  49. 'type' => 'Type',
  50. ];
  51. }
  52. }