Hi Jonny9,
why not creating another dataobject for logging? This way you cannot only log WHO is visiting you, also when and how often.
Member:
$has_many = ['VisitorLogs', 'VisitorLog']
class VisitorLog extends DataObject {
private static $db = [
'Guest' => 'Member', //the visitor, see Member::currentUserID() to get the current user
'Visited' => 'Member', //the member who got visited,
// ... timestamp and whatever you want to add
]
}
untested though...