Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace backend\models;
- use Yii;
- use trntv\filekit\behaviors\UploadBehavior;
- use yii\behaviors\SluggableBehavior;
- use yii\behaviors\BlameableBehavior;
- use yii\behaviors\TimestampBehavior;
- /**
- * This is the model class for table "event".
- *
- * @property int $id
- * @property string $nama
- * @property int $harga
- * @property string $url_gambar
- * @property string $waktu
- * @property string $tgl_mulai
- * @property string $tgl_akhir
- * @property string $lokasi
- * @property int $get_point
- * @property string $artikel
- * @property string $jenis
- */
- class Event extends \yii\db\ActiveRecord
- {
- /**
- * @var array
- */
- public $url_gambar;
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return 'event';
- }
- /**
- * {@inheritdoc}
- */
- public function behaviors()
- {
- return [
- [
- 'class' => UploadBehavior::class,
- 'attribute' => 'url_gambar',
- ],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['nama', 'harga', 'url_gambar', 'waktu', 'tgl_mulai', 'lokasi'], 'required'],
- [['harga', 'get_point'], 'default', 'value' => null],
- [['harga', 'get_point'], 'integer'],
- [['waktu', 'tgl_mulai', 'tgl_akhir'], 'safe'],
- [['artikel'], 'string'],
- [['nama', 'url_gambar', 'lokasi', 'jenis'], 'string', 'max' => 255],
- [['url_gambar'], 'safe'],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'nama' => 'Nama',
- 'harga' => 'Harga',
- 'url_gambar' => 'Url Gambar',
- 'waktu' => 'Waktu',
- 'tgl_mulai' => 'Tgl Mulai',
- 'tgl_akhir' => 'Tgl Akhir',
- 'lokasi' => 'Lokasi',
- 'get_point' => 'Get Point',
- 'artikel' => 'Artikel',
- 'jenis' => 'Jenis',
- ];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement