In ‘Siyār Aʿlām al-Nubalá’ (13/547), al-Dhahabī narrated that Abū Muḥammad ʿAbdullāh ibn Muḥammad – said:

“Ibn Hazm related to me the reason he began studying Fiqh.  He was once at a funeral prayer; so he entered the mosque, and sat down without praying. A man then said to him: ‘Get up and pray tahiyyat al-masjid’, and he was 26 at the time. Ibn Hazm himself said: ‘So, I got up and prayed. When we returned from the janāzah, I entered the mosque, and prayed before sitting down. It was then said to me: “Sit down, sit down. This is not a time to pray,” as it was after the time of ʿAsr. So, I walked away while I was very sad. I went to my teacher that had nurtured me, and said: “Direct me to the house of the scholar Abū ʿAbdillāh ibn Dahhun.” So, I went to him, told him of what had happened, and he directed me to ‘al-Muwaṭṭa’ of Mālik. So I began studying it at his hands, and continued studying it with him and others for a period of three years. After this, I began debating with the people.””