Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class KitController
- {
- //saves a domain object acquired from an HTML form & other sources
- function saveAction()
- {
- // acquire data from GET, POST, COOKIE, SESSION, database, et
- $inputData = $this->inputService->acquireData();
- // clean data
- $filteredData = $this->filterService->filter($inputData);
- // marshall data into an object
- $domainObject = $this->objectService->createObject($filteredData);
- //save object into a database
- $id = $this->repository->save($domainObject);
- // Send $id to View
- return new ViewModel(array(
- 'id' => $id
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement