/** * @return \yii\db\ActiveQuery */ public function getCodLibro() { return $this->hasOne(Libro::className(), ['codigo' => 'cod_libro']); }