public function getGearModel() { if ($this->gearModel === false) { $this->gearModel = $this->gear == '' ? null : Gear::findOne(['key' => (string) $this->gear]); } return $this->gearModel; }
/** * @return \yii\db\ActiveQuery */ public function getGear() { return $this->hasOne(Gear::className(), ['id' => 'gear_id']); }