[Attachment] Move Controller and Entities to a Component
There's no problem in having the templates in the core
This commit is contained in:
@@ -35,7 +35,7 @@ public static function getAvatarFileInfo(int $gsactor_id): array
|
||||
Cache::get("avatar-file-info-{$gsactor_id}",
|
||||
function () use ($gsactor_id) {
|
||||
return DB::dql('select f.file_hash, f.mimetype, f.title ' .
|
||||
'from App\Entity\Attachment f ' .
|
||||
'from Component\Attachment\Entity\Attachment f ' .
|
||||
'join App\Entity\Avatar a with f.id = a.attachment_id ' .
|
||||
'where a.gsactor_id = :gsactor_id',
|
||||
['gsactor_id' => $gsactor_id]);
|
||||
|
@@ -68,7 +68,7 @@ Simple enough.
|
||||
|
||||
### Attachments: Storing a reference in database
|
||||
Finally, you need a way to refer to previous files.
|
||||
GNU social calls that representation of `App\Entity\Attachment`.
|
||||
GNU social calls that representation of `Component\Attachment\Entity\Attachment`.
|
||||
If a note refers to an `Attachment` then you can link them
|
||||
using the entity `AttachmentToNote`.
|
||||
|
||||
@@ -97,7 +97,7 @@ can be generated from files. And `StoreRemoteMedia` to understand how to generat
|
||||
them from URLs.
|
||||
|
||||
The controller asking for them is the `App\Controller\Attachment::attachment_thumbnail` with
|
||||
a call to `App\Entity\AttachmentThumbnail::getOrCreate()`.
|
||||
a call to `Component\Attachment\Entity\AttachmentThumbnail::getOrCreate()`.
|
||||
|
||||
## Trade-offs between decoupling and complexity
|
||||
|
||||
|
Reference in New Issue
Block a user