/** * @return AttachmentQuery */ public function getAttachment() { return $this->hasOne(Attachment::className(), ['note_id' => 'id'])->inverseOf('note'); }
public function getAttach() { return $this->hasOne(Attachment::className(), ['id' => 'cover']); }