4], [['oil_use'], 'string', 'max' => 10], [['oil_model'], 'string', 'max' => 50], [['displacement_id'], 'exist', 'skipOnError' => true, 'targetClass' => DisplacementT::className(), 'targetAttribute' => ['displacement_id' => 'id']], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'displacement_id' => 'Displacement ID', 'year' => 'Year', 'price' => 'Price', 'oil_use' => 'Oil Use', 'oil_model' => 'Oil Model', 'created_at' => 'Created At', 'updated_at' => 'Updated At', ]; } /** * @return \yii\db\ActiveQuery */ public function getDisplacement() { return $this->hasOne(DisplacementT::className(), ['id' => 'displacement_id']); } }