Adding some more details to what Nick Alexeev has told you in his good answer, you may find additional information on toroid mounting in this document ("Effective Mounting of Toroidal Cores", by Richard Barden; Lodestone Pacific).
Excerpts (emphasis mine):
The toroids can be attached to the mount with either adhesives or mechanical
means. Cup shaped toroid mounts can be filled with a potting or encapsulation
compound to both adhere and protect the wound toroid. Horizontal mounting
offers both a low profile and a low center of gravity in applications that will experience shock and vibration. As the toroid’s diameter gets larger, horizontal mounting begins to use up valuable circuit board real estate. If there is room in the enclosure, vertical mounting is used to save board space.
[...]

The leads from the toroidal winding are attached to the mount’s terminals, usually by soldering as shown in Figure
6. If the winding’s wire is large and stiff enough, the wire can be “self leaded” and positioned through the header or
mount into the printed circuit board, as in Figures 3, 7 and 8. The advantage of self leading mounts is that the expense and vulnerability of an additional intermediate solder connection is avoided. The toroids can be attached to the mount with either adhesives, mechanical means or by encapsulation. Cup shaped toroid mounts, (Figures 8, 9 and 10) can be filled with a potting or encapsulation compound to both adhere and protect the wound toroid. Vertical mounting saves circuit board real estate when a toroid’s diameter gets larger, but creates a component height
issue. Vertical mounting also raises the component’s center of gravity making it vulnerable to shock and vibration.