Advertisement
Guest User

Untitled

a guest
May 3rd, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. class KitController
  2. {
  3. //saves a domain object acquired from an HTML form & other sources
  4. function saveAction()
  5. {
  6. // acquire data from GET, POST, COOKIE, SESSION, database, et
  7. $inputData = $this->inputService->acquireData();
  8.  
  9. // clean data
  10. $filteredData = $this->filterService->filter($inputData);
  11.  
  12. // marshall data into an object
  13. $domainObject = $this->objectService->createObject($filteredData);
  14.  
  15. //save object into a database
  16. $id = $this->repository->save($domainObject);
  17.  
  18. // Send $id to View
  19. return new ViewModel(array(
  20. 'id' => $id
  21. );
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement