/** * @return array * @throws Exception */ public function fetchAll() { if ($this->statement instanceof PDOStatement) { return $this->statement->fetchall(PDO::FETCH_ASSOC); } else { throw new Exception('No statement defined to fetch data from. You have to prepare a statement first!', 1347951370); } }
public function fetchAllClass($class) { return $this->stmt->fetchall(\PDO::FETCH_CLASS, $class); }