Implement attachments module with CRUD operations and integration points

- Added `attachments` module for creating, reading, updating, and deleting attachments.
- Introduced new classes such as `attachments`, `attachment_store`, `attachment_content`, and `attachment_relation` to handle attachment operations and their relationships.
- Integrated `attachments` features into `db_object_t` for seamless object-attachment interactions.
- Added `attachments_i` interface for standardized attachments module operations.
- Created `attachmentsRoute` for defining endpoints related to attachments.
- Enabled module configuration through `attachments_enabled_c` for attachment management control.
This commit is contained in:
Jeppe Bundgaard
2025-09-22 10:28:22 +02:00
parent 94bbf0a106
commit 33a26cffc5
13 changed files with 567 additions and 0 deletions
@@ -0,0 +1,27 @@
<?php
namespace routes;
use attachments\helpers\attachment;
use attachments\helpers\attachment_content;
use classes\attachments;
use objects\orders_o;
use traits\route_t;
class attachmentsRoute
{
use route_t;
public function run(): void
{
$this->get('/attachments/example', function () {
global $response;
throw new \Exception('EXAMPLE ROUTE, SHOULD BE IMPLEMENTED IN THE INDIVIDUAL OBJECT ROUTES');
$orders_o = new orders_o();
$orders_o->select(22636);
// Debug: Create an attachment
$orders_o->addAttachment((new attachment_content())->setOther('Hello World!'));
$response->success($orders_o->listAttachments());
});
}
}