D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
epaji.com
/
public_html
/
hindiusa
/
models
/
Filename :
Events.php
back
Copy
<?php namespace app\models; use Yii; /** * This is the model class for table "events". * * @property int $id * @property int $school_id * @property int $event_type_id * @property string $title * @property string $summary * @property string $description * @property string $start_date * @property string $start_time * @property string $end_date * @property string $end_time * @property int|null $seat * @property string $venue * @property int $status * @property string $created * * @property EventTypes $eventType * @property Schools $school */ class Events extends \yii\db\ActiveRecord { public $thumbimage; /** * {@inheritdoc} */ public static function tableName() { return 'events'; } /** * {@inheritdoc} */ public function rules() { return [ [['school_id', 'event_type_id', 'title', 'summary', 'description', 'start_date', 'start_time', 'end_date', 'end_time', 'thumb_image', 'venue', 'status', 'created'], 'required'], [['school_id', 'event_type_id', 'seat', 'status','display_status'], 'integer'], [['description'], 'string'], [['start_date', 'start_time', 'end_date', 'end_time', 'created'], 'safe'], [['title', 'venue'], 'string', 'max' => 200], [['thumb_image'], 'string', 'max' => 300], [['summary'], 'string', 'max' => 500], [['thumbimage'],'image', 'extensions' => 'jpg,jpeg,png','maxSize' => 900000], [['school_id'], 'exist', 'skipOnError' => true, 'targetClass' => Schools::className(), 'targetAttribute' => ['school_id' => 'id']], [['event_type_id'], 'exist', 'skipOnError' => true, 'targetClass' => EventTypes::className(), 'targetAttribute' => ['event_type_id' => 'id']], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => Yii::t('app', 'ID'), 'school_id' => Yii::t('app', 'School'), 'event_type_id' => Yii::t('app', 'Event Type'), 'title' => Yii::t('app', 'Title'), 'summary' => Yii::t('app', 'Summary'), 'description' => Yii::t('app', 'Description'), 'start_date' => Yii::t('app', 'Start Date'), 'start_time' => Yii::t('app', 'Start Time'), 'end_date' => Yii::t('app', 'End Date'), 'end_time' => Yii::t('app', 'End Time'), 'seat' => Yii::t('app', 'Seat'), 'venue' => Yii::t('app', 'Venue'), 'status' => Yii::t('app', 'Status'), 'created' => Yii::t('app', 'Created'), 'thumb_image' => Yii::t('app', 'Thumb Image'), 'thumbimage' => Yii::t('app', 'Upload Event Image'), 'display_status' => Yii::t('app', 'Display for Main Website'), ]; } /** * Gets query for [[EventType]]. * * @return \yii\db\ActiveQuery */ public function getEventType() { return $this->hasOne(EventTypes::className(), ['id' => 'event_type_id'])->inverseOf('events'); } /** * Gets query for [[School]]. * * @return \yii\db\ActiveQuery */ public function getSchool() { return $this->hasOne(Schools::className(), ['id' => 'school_id'])->inverseOf('events'); } }