Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kenshin9's avatar

Models knowing about the session.

What do you think about models knowing about the session variables? Would you think they should be concerned with them? The session stores the user's access level, and based on the access level, the user only has access to certain data in the model. So you could do something like create scopes for the data based on the user access level, which again is in the session.

Or would you separate that out into another class to handle, or some other way?

0 likes
0 replies

Please or to participate in this conversation.