Advertisement
Guest User

Untitled

a guest
Jun 3rd, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. public function getRefreshableFoos($hour) {
  2. // not completely convinced hour will always be an int. let's be sure.
  3. $hour = (int)$hour;
  4. $sql = 'SELECT blah, blih, bloh FROM foos';
  5. $stmt = $this->pdo->query($sql);
  6. $rows = $stmt->fetchAll(PDO::FETCH_GROUP | PDO::FETCH_UNIQUE);
  7. $refreshables = [];
  8. foreach ($rows as $id=> $row) {
  9. if ($hour === 0)
  10. {
  11. $hour = 24;
  12. }
  13. if ($codePRS % 24 === $hour) {
  14. $refreshables[$id] = $row;
  15. }
  16. }
  17. return $refreshables;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement