query("SELECT * FROM users"); $users = $stmt->fetchAll(PDO::FETCH_OBJ);
Here, we first include the User class from the MyLibrary package. Then, we call the findAll method of the User class to retrieve all the users. The implementation of the findAll method would be something like:class User { public static function findAll() { // code to retrieve all the users from the database return $users; } }In this example, the code to retrieve the users is implemented inside the User class. The User class is part of the MyLibrary package, which contains other classes and functions related to user management.