216 lines
5.1 KiB
Markdown
216 lines
5.1 KiB
Markdown
Create a Contao 5.7 bundle (PHP 8.4)
|
|
|
|
Vendor: MummertMedia
|
|
Bundle: EventManagerBundle
|
|
Composer name: mummert-media/eventmanager-bundle
|
|
Type: contao-bundle
|
|
|
|
This bundle is internal only.
|
|
|
|
IMPORTANT:
|
|
Only implement backend functionality.
|
|
No frontend logic.
|
|
No controllers.
|
|
No services.
|
|
No access logic.
|
|
No event listeners.
|
|
No future planning.
|
|
Only backend entities and relations.
|
|
|
|
====================================================
|
|
GOAL
|
|
====================================================
|
|
|
|
Extend Contao backend with:
|
|
|
|
1) New entity: tl_organization named Organisationen, just german translation
|
|
2) New entity: tl_location named Veranstaltungsorte, just german translation
|
|
3) Join table: tl_member_organization
|
|
4) Join table: tl_calendar_events_organization
|
|
5) Extend tl_calendar_events with:
|
|
- location_id (exactly one location) with dropdown in Backend (title ASC)
|
|
- organization assignment (multiple via join table)
|
|
6) Extend tl_member so that:
|
|
- A member can belong to multiple organizations
|
|
7) Extend tl_organization so that:
|
|
- Multiple members can be assigned to it
|
|
|
|
Everything manageable via Contao backend only.
|
|
|
|
====================================================
|
|
DATABASE TABLES
|
|
====================================================
|
|
|
|
Use Contao DCA SQL definitions (DBAL 4 compatible).
|
|
Do NOT use serialized fields.
|
|
Do NOT use string length values like "255".
|
|
Use integer values.
|
|
|
|
------------------------------------
|
|
tl_organization + add german translation
|
|
------------------------------------
|
|
|
|
id int unsigned auto_increment
|
|
pid int unsigned default 0
|
|
tstamp int unsigned default 0
|
|
dateAdded int unsigned default 0
|
|
title varchar(255)
|
|
alias varchar(128)
|
|
logo binary(16) nullable
|
|
street varchar(255)
|
|
street2 varchar(255)
|
|
postal varchar(255)
|
|
city varchar(255)
|
|
state varchar(255)
|
|
country varchar(2)
|
|
phone varchar(64)
|
|
email varchar(255)
|
|
website varchar(255)
|
|
lat decimal(10,8)
|
|
lng decimal(11,8)
|
|
description text nullable
|
|
published char(1)
|
|
isExternal char(1)
|
|
type varchar(32)
|
|
|
|
------------------------------------
|
|
tl_location + add german translation
|
|
------------------------------------
|
|
|
|
id int unsigned auto_increment
|
|
tstamp int unsigned default 0
|
|
dateAdded int unsigned default 0
|
|
title varchar(255)
|
|
alias varchar(128)
|
|
description text nullable
|
|
street varchar(255)
|
|
street2 varchar(255)
|
|
postal varchar(255)
|
|
city varchar(255)
|
|
state varchar(255)
|
|
country varchar(2) default 'de'
|
|
lat decimal(10,8)
|
|
lng decimal(11,8)
|
|
image binary(16) nullable
|
|
published char(1)
|
|
|
|
------------------------------------
|
|
tl_member_organization
|
|
------------------------------------
|
|
|
|
id int unsigned auto_increment
|
|
tstamp int unsigned default 0
|
|
member_id int unsigned
|
|
organization_id int unsigned
|
|
|
|
------------------------------------
|
|
tl_calendar_events_organization
|
|
------------------------------------
|
|
|
|
id int unsigned auto_increment
|
|
tstamp int unsigned default 0
|
|
event_id int unsigned
|
|
organization_id int unsigned
|
|
|
|
====================================================
|
|
DCA REQUIREMENTS
|
|
====================================================
|
|
|
|
1) tl_organization:
|
|
- Backend list view
|
|
- Editable fields
|
|
- Published toggle
|
|
- Alias field
|
|
- Type as select field with static options:
|
|
accommodation, shopping, culture
|
|
- Add multi-relation field for members
|
|
(store relation in tl_member_organization)
|
|
|
|
2) tl_location:
|
|
- Backend list view
|
|
- Editable fields
|
|
- Published toggle
|
|
- Alias field
|
|
|
|
3) tl_calendar_events:
|
|
- Add field location_id (select, mandatory)
|
|
foreignKey: tl_location.title
|
|
- Add multi-organization relation
|
|
(store relation in tl_calendar_events_organization)
|
|
|
|
4) tl_member:
|
|
- Add multi-organization relation
|
|
(store relation in tl_member_organization)
|
|
|
|
====================================================
|
|
RELATION HANDLING
|
|
====================================================
|
|
|
|
Use proper many-to-many handling via join tables.
|
|
Use relation definitions in DCA.
|
|
Do NOT use serialized arrays.
|
|
Do NOT store IDs as comma-separated strings.
|
|
|
|
====================================================
|
|
BACKEND INTEGRATION
|
|
====================================================
|
|
|
|
Register backend modules for:
|
|
|
|
- Organisationen
|
|
- Veranstaltungsorte
|
|
|
|
Under backend group content
|
|
|
|
|
|
Use standard Contao backend module registration.
|
|
|
|
====================================================
|
|
PROJECT STRUCTURE
|
|
====================================================
|
|
|
|
Generate:
|
|
|
|
src/
|
|
MummertMediaEventManagerBundle.php
|
|
DependencyInjection/
|
|
MummertMediaEventManagerExtension.php
|
|
Contao/
|
|
Manager/
|
|
Plugin.php
|
|
|
|
contao/
|
|
dca/
|
|
tl_organization.php
|
|
tl_location.php
|
|
tl_member.php
|
|
tl_calendar_events.php
|
|
config/
|
|
config.php
|
|
|
|
config/
|
|
services.yaml
|
|
|
|
composer.json
|
|
|
|
====================================================
|
|
QUALITY RULES
|
|
====================================================
|
|
|
|
- declare(strict_types=1);
|
|
- PHP 8.4
|
|
- DBAL 4 compatible SQL
|
|
- no deprecated Contao 4 syntax
|
|
- no frontend logic
|
|
- no controllers
|
|
- no services
|
|
- no placeholders
|
|
- complete working DCA
|
|
- ready to install via path repository
|
|
|
|
====================================================
|
|
OUTPUT
|
|
====================================================
|
|
|
|
Generate full file contents for all required files.
|
|
Code must be production-ready. |