Base64Img.php 928 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace app\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "{{%base64_img}}".
  6. *
  7. * @property string $hash
  8. * @property string|null $base64code
  9. * @property string $file_path
  10. */
  11. class Base64Img extends \app\common\models\EActiveRecord
  12. {
  13. /**
  14. * {@inheritdoc}
  15. */
  16. public static function tableName()
  17. {
  18. return '{{%base64_img}}';
  19. }
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function rules()
  24. {
  25. return [
  26. [['hash'], 'required'],
  27. [['base64code'], 'string'],
  28. [['hash'], 'string', 'max' => 32],
  29. [['file_path'], 'string', 'max' => 500],
  30. [['hash'], 'unique'],
  31. ];
  32. }
  33. /**
  34. * {@inheritdoc}
  35. */
  36. public function attributeLabels()
  37. {
  38. return [
  39. 'hash' => 'Hash',
  40. 'base64code' => 'Base64code',
  41. 'file_path' => 'File Path',
  42. ];
  43. }
  44. }