Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. public function fetchAll($params = array())
  2. {
  3. $params = $params->toArray();
  4. $options = array();
  5.  
  6. if (isset($params['page'])) {
  7. $options['options']['pageSize'] = $this->pageSize;
  8. $options['options']['page'] = $params['page'];
  9. }
  10.  
  11. foreach ($params['filter'] as $paramKey => $param) {
  12. switch ($paramKey) {
  13. case 'projectname':
  14. $options['where']['projectname'] = $param;
  15. break;
  16.  
  17. case 'username':
  18. $options['where']['username'] = $param;
  19. break;
  20.  
  21. case 'email':
  22. $options['where']['email'] = $param;
  23. break;
  24.  
  25. default:
  26. $options['filter'][$paramKey] = $param;
  27. }
  28. }
  29.  
  30. return $this->mapper->fetchAll($options);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement