Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function getRefreshableFoos($hour) {
- // not completely convinced hour will always be an int. let's be sure.
- $hour = (int)$hour;
- $sql = 'SELECT blah, blih, bloh FROM foos';
- $stmt = $this->pdo->query($sql);
- $rows = $stmt->fetchAll(PDO::FETCH_GROUP | PDO::FETCH_UNIQUE);
- $refreshables = [];
- foreach ($rows as $id=> $row) {
- if ($hour === 0)
- {
- $hour = 24;
- }
- if ($codePRS % 24 === $hour) {
- $refreshables[$id] = $row;
- }
- }
- return $refreshables;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement