Split DBStructure & View to avoid DB-calls and dependencies for basic operations

- new "Definition" classes vor DB and Views
- new "Writer" classes to create SQL definitions for DB and Views
- DBStructure & View are responsible to execute DB-querys
This commit is contained in:
Philipp 2022-07-12 23:21:16 +02:00
parent a2c929d128
commit a910fd8864
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
30 changed files with 898 additions and 608 deletions

View file

@ -26,6 +26,7 @@ use Friendica\Core\Protocol;
use Friendica\Database\Database;
use Friendica\Database\DBA;
use Friendica\Database\DBStructure;
use Friendica\DI;
use Friendica\Model\Post;
class Content
@ -44,7 +45,7 @@ class Content
throw new BadMethodCallException('Empty URI_id');
}
$fields = DBStructure::getFieldsForTable('post-content', $data);
$fields = DI::dbaDefinition()->getFieldsForTable('post-content', $data);
// Additionally assign the key fields
$fields['uri-id'] = $uri_id;
@ -67,7 +68,7 @@ class Content
throw new BadMethodCallException('Empty URI_id');
}
$fields = DBStructure::getFieldsForTable('post-content', $data);
$fields = DI::dbaDefinition()->getFieldsForTable('post-content', $data);
// Remove the key fields
unset($fields['uri-id']);