Class to get all fields and methods like findById, ...
find (id) : RecordSet
findWithLastName(String) : RecordSet
update (id, lastname, firstname, numberOfDependents)
insert (lastname, firstname, numberOfDependents)
delete (id)
Add wrapper around the database module, so that the forms themselves do only use the objects e.g. supplier, invoice, delivery note ...
These classes contain the logic to select, update, insert or delete entries.
The classes handle the SQL queries (prepared statements) and additional permission handling.
Permission layer / component:
Idea is to create a component or layer that handles all permissions. So a central configuration for permissions is required.
This component could be made configurable via a form, so every admin can configure permissions as required.
This component has to contain a list of areas (invoice, delivery note, ...) with a set of operations (add, edit, delete, view, ...) for each permission group (admin, maintainer, auditor, ...).
Idea:
- Form to create groups and manage the users in that group.
- In the permission configurator each group gets areas with permissions assigned.
- A user can be in multiple groups.
- The default for a new group is the denial of all areas. If the requirement is that every user can see the delivery notes, a default group with that permission needs to be created and every user added to it.
Directory structure:
modules/
dataObjects/
deliveryNote.php
supplier.php
product.php
...
Abstract class / interface DataObject
All classes are inherited from this. -> The RecordSet
(Array) can contain this objects and can be used for all of them.