芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/airport-back/models/Bookingitem.php
<?php namespace app\models; use Yii; /** * This is the model class for table "{{%booking_item}}". * * @property int $id * @property int|null $booking_id * @property int|null $seat_id * * @property Booking $booking * @property Seat $seat */ class Bookingitem extends \yii\db\ActiveRecord { /** * {@inheritdoc} */ public static function tableName() { return '{{%booking_item}}'; } /** * {@inheritdoc} */ public function rules() { return [ [['booking_id', 'seat_id'], 'integer'], [['booking_id'], 'exist', 'skipOnError' => true, 'targetClass' => Booking::class, 'targetAttribute' => ['booking_id' => 'id']], [['seat_id'], 'exist', 'skipOnError' => true, 'targetClass' => Seat::class, 'targetAttribute' => ['seat_id' => 'id']], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'booking_id' => 'Booking ID', 'seat_id' => 'Seat ID', ]; } /** * Gets query for [[Booking]]. * * @return \yii\db\ActiveQuery */ public function getBooking() { return $this->hasOne(Booking::class, ['id' => 'booking_id']); } /** * Gets query for [[Seat]]. * * @return \yii\db\ActiveQuery */ public function getSeat() { return $this->hasOne(Seat::class, ['id' => 'seat_id']); } }