mirror of
https://github.com/friendica/friendica
synced 2025-04-28 11:44:23 +02:00
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:
parent
a2c929d128
commit
a910fd8864
30 changed files with 898 additions and 608 deletions
|
@ -25,6 +25,7 @@ use Friendica\Database\DBA;
|
|||
use \BadMethodCallException;
|
||||
use Friendica\Database\Database;
|
||||
use Friendica\Database\DBStructure;
|
||||
use Friendica\DI;
|
||||
|
||||
class User
|
||||
{
|
||||
|
@ -47,7 +48,7 @@ class User
|
|||
return false;
|
||||
}
|
||||
|
||||
$fields = DBStructure::getFieldsForTable('post-user', $data);
|
||||
$fields = DI::dbaDefinition()->getFieldsForTable('post-user', $data);
|
||||
|
||||
// Additionally assign the key fields
|
||||
$fields['uri-id'] = $uri_id;
|
||||
|
@ -81,7 +82,7 @@ class User
|
|||
throw new BadMethodCallException('Empty URI_id');
|
||||
}
|
||||
|
||||
$fields = DBStructure::getFieldsForTable('post-user', $data);
|
||||
$fields = DI::dbaDefinition()->getFieldsForTable('post-user', $data);
|
||||
|
||||
// Remove the key fields
|
||||
unset($fields['uri-id']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue