XF 2.0 Add extra field to xf_session_activity

Jean-Baptiste

Well-known member
Hello,

I would like to extend the xf_session_activity table and set a new field value but it doesn't works.

The xf_session_activity system doesn't looks to be built with the EM things.

That doesn't works :
\XF::em()->find('XF:SessionActivity', $visitor['user_id']);

Any ideas to update a field in the XF SESSION ACTIVITY table without using queries ?

Best regards;
 
There is a session activity entity, but the user ID is not the primary key alone (though for registered members, it is effectively that). That explains why your simple find() call won't work.

We don't write to the table using entities though, for efficiency purposes, as the values are updated on every page. You'll likely need to extend/override the method that does that to write to the table as expected.
 
Top Bottom