An array-based ORM platform for Laminas. Includes many filters and view helpers. Requires jtranslate and juser.
composer require jroedel/laminas-sion-model
- Simple array-based ORM
- Automatic caching
- Automatic logging
- Automatic reporting on who changed what, when.
- Integrated mailing support
- Integrated data problem management
Entities are defined in configuration under the ['sion_model']['entities']
key. You define a
mapping of the entity field names to database column names, tell the ORM what the table is called
and how these entities are integrated into the router tree.
How to implement a Book database:
-
Extend the SionTable class, and create a ServiceFactory to build it.
-
Define your entity configuration in the
module.config.php
referencing the example filesionmodel.global.php.dist
and properties fromSionModel\Entity\Entity
. -
Implement the
processBookRow
function and register the row processor function in the config. -
Create a BookForm extending the
SionForm
class. -
Extend the SionController class
With data problem management you create two classes to detect problems with a certain entity type. The user can choose to ignore a particular error. A pre-made GUI is included which shows all the collected problems.
-
Define 1 or more problems under the
['sion_model']['problem_specifications']
config key inmodule.config.php
:```'sion_model' => [ 'problem_providers' => [ 'Project\Model\ProjectTable', ], 'problem_specifications' => [ 'person-no-email' => [ 'entity' => 'person', 'defaultSeverity' => EntityProblem::SEVERITY_ERROR, 'text' => 'No email associated with person', ], ], ],
-
Implement the
ProblemProviderInterface
in theProject\Model\ProjectTable
class.
- Support entity-level ACL rules