findEntity($sql, [$id]); } /** * @param string $userId * @param string $from * @param string $until * @param int $limit * @param int $offset * @return Favorite[] */ public function findBetween($userId, $from, $until, $limit=null, $offset=null) { $sql = 'SELECT * FROM `*PREFIX*polls_access` '. 'WHERE `userId` = ?'. 'AND `timestamp` BETWEEN ? and ?'; return $this->findEntities($sql, [$userId, $from, $until], $limit, $offset); } /** * @param int $limit * @param int $offset * @return Favorite[] */ public function findAll($limit=null, $offset=null) { $sql = 'SELECT * FROM `*PREFIX*polls_access`'; return $this->findEntities($sql, [], $limit, $offset); } }