PDO FETCH_CLASS and Namespacing issue
问题 I am trying to use PDO::FETCH_CLASS on an object. I am using namespacing and just entering: $result = $query->fetchAll(\PDO::FETCH_CLASS, 'Product'); or $result = $query->fetchAll(\PDO::FETCH_CLASS, '\Product'); results in PHP looking for Product.php in the root of the app. I can successfully instantiate a new Product though using: $product = new Product(); So I know my name spacing is working. Is this not possible? Or do I need to instantiate a Product first then populate it after from the