FaceFeature.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. namespace app\models\entity;
  3. use yii\db\ActiveRecord;
  4. /**
  5. * @property int $id [int(5)]
  6. * @property string $face_feature
  7. * @property int $id_account [int(5)]
  8. * @property int $date [timestamp]
  9. * @property string $token_device [varchar(255)]
  10. */
  11. class FaceFeature extends ActiveRecord
  12. {
  13. /**
  14. * @return string название таблицы, сопоставленной с этим ActiveRecord-классом.
  15. */
  16. public static function tableName()
  17. {
  18. return '{{face_feature}}';
  19. }
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function rules()
  24. {
  25. return [
  26. //[['id'], 'required'],
  27. [['id', 'id_account'], 'integer'],
  28. //[['face_feature'], 'text'],
  29. [['token_device'], 'string', 'max' => 255],
  30. [['id'], 'unique']
  31. ];
  32. }
  33. /**
  34. * {@inheritdoc}
  35. */
  36. public function attributeLabels()
  37. {
  38. return [
  39. 'id' => 'ID',
  40. 'face_feature' => 'Face feature',
  41. 'id_account' => 'Account ID',
  42. 'date' => 'Date',
  43. 'token_device' => 'Token Device'
  44. ];
  45. }
  46. /**
  47. * @return \yii\db\ActiveQuery
  48. */
  49. public function getAccount()
  50. {
  51. return $this->hasOne(Accounts::className(), ['id' => 'id_account']);
  52. }
  53. public function getId()
  54. {
  55. return $this->id;
  56. }
  57. }