Since legacy code is still widespread through the repository it is important to understand it, too.
The (php) code is roughly structured with Model - View - Controller.
The communication with the database is found in Model classes.
For example we can find
sql-commands to manipulate a foodsaver in
Those are executed with the functions inherited from the
Db class (see
use Foodsharing\Lib\Db\Db;, for example
q stands for
For a general description what „domain logic“ is, see section Transactions.
Note that all of the following guidelines have a lot of exceptions in the existing code. Nevertheless try to heed the following guidelines in code you write and refactor.