public static function getAllUsers() { $query = "SELECT * FROM Users"; $users = array(); try { $db = Database::getDB(); $statement = $db->prepare($query); $statement->execute(); $users = UsersDB::getUsersArray($statement->fetchAll(PDO::FETCH_ASSOC)); $statement->closeCursor(); } catch (PDOException $e) { // Not permanent error handling echo "<p>Error getting all users " . $e->getMessage() . "</p>"; } return $users; }
public static function getUsersBy($type, $value) { // Returns a User object whose $type field has value $value $userRows = UsersDB::getUserRowSetsBy($type, $value, '*'); return UsersDB::getUsersArray($userRows); }
public static function getUsersBy($type = null, $value = null) { // Returns User objects whose $type field has value $value $userRows = UsersDB::getUserRowSetsBy($type, $value); return UsersDB::getUsersArray($userRows); }
public static function getUsersBy($type = null, $value = null) { $userRows = UsersDB::getUserRowSetsBy($type, $value); return UsersDB::getUsersArray($userRows); }