The concept of Mary's vow of virginity had already appeared in the Protoevangelium (4:1) which asserted that Mary's mother, Anne, gave Mary as a ``virgin of the Lord'' in service in the Temple, and that Joseph, a widower, was to serve as her guardian (legal protections for women depended on their having a male protector: father, brother, or, failing that, a husband).
Anne
Mary