100], [['car_year'], 'string', 'max' => 50], [['name'], 'unique'], [['displacement_id'], 'exist', 'skipOnError' => true, 'targetClass' => DisplacementT::className(), 'targetAttribute' => ['displacement_id' => 'id']], [['series_id'], 'exist', 'skipOnError' => true, 'targetClass' => SeriesT::className(), 'targetAttribute' => ['series_id' => 'id']], [['brand_id'], 'exist', 'skipOnError' => true, 'targetClass' => BrandT::className(), 'targetAttribute' => ['brand_id' => 'id']], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'name' => 'Name', 'brand_id' => 'Brand ID', 'series_id' => 'Series ID', 'displacement_id' => 'Displacement ID', 'car_year' => 'Car Year', 'created_at' => 'Created At', 'updated_at' => 'Updated At', ]; } /** * @return \yii\db\ActiveQuery */ public function getDisplacement() { return $this->hasOne(DisplacementT::className(), ['id' => 'displacement_id']); } /** * @return \yii\db\ActiveQuery */ public function getSeries() { return $this->hasOne(SeriesT::className(), ['id' => 'series_id']); } /** * @return \yii\db\ActiveQuery */ public function getBrand() { return $this->hasOne(BrandT::className(), ['id' => 'brand_id']); } }