No, this should not be. The storage type should be separate from your business logic. For instance:
I have one simple plugin that performs an access check and puts the user object in the registry. Thus, instead of an access session, the model has access to the registry, which is well defined.
$User = Zend_Registry::get('User'); // User model object
From a theoretical point of view, everything should be accessible through data cards. In the future, if you move from the session store to another, you will only need to update it in one place. Your models do not need to know where the data came from.
If you use several ways to get your data, it may cause some problems when your application becomes large.
A proposal for an approach to OOP and multilevel systems is to create specialized objects and layers and simplify simple actions that prevent the spread of certain actions throughout the code.
But then again, you don’t need to change this unless you see the benefits. Keep in mind that sometimes refactoring is more effective than trying to predict everything.
source share