Added queryToArray helper method to resource base class