Clean up gateway classes
Description
I would like to introduce some standard for gateway functions and successively update all gateway classes. There are some functions that perform more queries than necessary or that are too complex.
- Data that is not a primitive type (or an array of primitive types) should be returned as a DTO
- Functions that add data to the DB and return the id should throw an exception in case of an error. They should not return -1 to indicate errors.
- Functions that update an entry should not return anything and throw an exception in case of an error. It should be expected that they succeed. They should not return a boolean.
- Functions should not be too complex and should not execute too many queries. If a function contains logic or executes several queries, it should be split up and the logic can be moved into a transaction class. This will also remove unnecessary queries.
- Parameters and return values should not be
false
to indicate empty or missing data. They should either benull
or an exception should be thrown.
And additionally some code style:
- Remove unused functions
- Add documentation to all functions
Classes
-
AchievementGateway -
ActivityGateway -
ApplicationGateway -
BasketGateway -
BellGateway -
BlogGateway -
BuddyGateway -
BusinessCardGateway -
ContentGateway -
EventGateway -
FoodsaverGateway -
FoodSharePointGateway -
GroupGateway -
LegalGateway -
LoginGateway -
MailboxGateway -
MailsGateway -
MaintenanceGateway -
MapGateway -
MessageGateway -
PassportGeneratorGateway -
ProfileGateway -
PushNotificationGateway -
QuizGateway -
ForumGateway -
ForumFollowerGateway -
RegionGateway -
ReportGateway -
SearchGateway -
SettingsGateway -
StatsGateway -
StoreGateway -
StoreChainGateway -
TeamGateway -
UploadsGateway -
VotingGateway -
WallPostGateway -
WorkGroupGateway
Edited by Alex