When I fetchAll()
query results (SELECT * FROM users ...
) as an array of objects, I want these objects to be of a certain class, namely User
.
- How do I force PDO to use the data type
User
for the result objects, and - do I have to define all member variables corresponding to the field names in the class?