Simple example of a doctrine environment featuring users and groups.
-
Install packages
composer install
-
Update references to namespaces
composer refresh
-
Configure the database
3.1. Create the file database-secret.json in
/config/
and fill in the parameters3.2. Create the database tables
composer doctrine-update
-
Setup initial data
Creates a user
tomb
and groupadmin
. Then adds the user to the group.composer setup
-
Test target code
Tests if user
tomb
is part of the groupadmin
.composer test
field | type |
---|---|
id | string |
firstName | string |
lastName | string |
mailAddress | string |
office | string |
lastModified | DateTime |
groups | Group[] |
field | type |
---|---|
id | int |
name | string |
description | string |
users | User[] |
A table to manage the many-to-many relationship with additional properties [Ref].
field | type |
---|---|
group_id | Group |
user_id | User |
role | string |