Advertisement
Guest User

event.php

a guest
Apr 24th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. <?php
  2.  
  3. namespace backend\models;
  4.  
  5. use Yii;
  6. use trntv\filekit\behaviors\UploadBehavior;
  7. use yii\behaviors\SluggableBehavior;
  8. use yii\behaviors\BlameableBehavior;
  9. use yii\behaviors\TimestampBehavior;
  10.  
  11.  
  12.  
  13. /**
  14. * This is the model class for table "event".
  15. *
  16. * @property int $id
  17. * @property string $nama
  18. * @property int $harga
  19. * @property string $url_gambar
  20. * @property string $waktu
  21. * @property string $tgl_mulai
  22. * @property string $tgl_akhir
  23. * @property string $lokasi
  24. * @property int $get_point
  25. * @property string $artikel
  26. * @property string $jenis
  27. */
  28. class Event extends \yii\db\ActiveRecord
  29. {
  30. /**
  31. * @var array
  32. */
  33. public $url_gambar;
  34.  
  35. /**
  36. * {@inheritdoc}
  37. */
  38. public static function tableName()
  39. {
  40. return 'event';
  41. }
  42.  
  43.  
  44. /**
  45. * {@inheritdoc}
  46. */
  47. public function behaviors()
  48. {
  49. return [
  50. [
  51. 'class' => UploadBehavior::class,
  52. 'attribute' => 'url_gambar',
  53. ],
  54. ];
  55. }
  56.  
  57. /**
  58. * {@inheritdoc}
  59. */
  60. public function rules()
  61. {
  62. return [
  63. [['nama', 'harga', 'url_gambar', 'waktu', 'tgl_mulai', 'lokasi'], 'required'],
  64. [['harga', 'get_point'], 'default', 'value' => null],
  65. [['harga', 'get_point'], 'integer'],
  66. [['waktu', 'tgl_mulai', 'tgl_akhir'], 'safe'],
  67. [['artikel'], 'string'],
  68. [['nama', 'url_gambar', 'lokasi', 'jenis'], 'string', 'max' => 255],
  69.  
  70. [['url_gambar'], 'safe'],
  71.  
  72.  
  73.  
  74.  
  75. ];
  76. }
  77.  
  78. /**
  79. * {@inheritdoc}
  80. */
  81. public function attributeLabels()
  82. {
  83. return [
  84. 'id' => 'ID',
  85. 'nama' => 'Nama',
  86. 'harga' => 'Harga',
  87. 'url_gambar' => 'Url Gambar',
  88. 'waktu' => 'Waktu',
  89. 'tgl_mulai' => 'Tgl Mulai',
  90. 'tgl_akhir' => 'Tgl Akhir',
  91. 'lokasi' => 'Lokasi',
  92. 'get_point' => 'Get Point',
  93. 'artikel' => 'Artikel',
  94. 'jenis' => 'Jenis',
  95. ];
  96. }
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement