Reputation: 5075
If i'm trying to keep with my controllers thin, and my models unaware of the details of their persistance, where should I be saving/accessing my models? I can't put it in the controller, and I can't put it in the domain object, is there supposed to be some other layer/object which handles this type of processing? Thanks!
Upvotes: 0
Views: 92
Reputation: 30170
I use table gateways in my controllers
$userTableGateway = new UserTableGateway();
$userTableGateway->getUser( 5 ); // returns a user object
$userTableGateway->insert( $user ); // Adds a new user
$userTableGateway->save( $user ); // Saves a user
Upvotes: 1