mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-11 09:34:26 +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
|
@ -24,7 +24,7 @@ namespace Friendica\Model\Post;
|
|||
use Friendica\Core\Logger;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\Database\Database;
|
||||
use Friendica\Database\DBStructure;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Post;
|
||||
|
||||
class History
|
||||
|
@ -37,7 +37,7 @@ class History
|
|||
*/
|
||||
public static function add(int $uri_id, array $item)
|
||||
{
|
||||
$allfields = DBStructure::definition('', false);
|
||||
$allfields = DI::dbaDefinition()->getAll();
|
||||
$fields = array_keys($allfields['post-history']['fields']);
|
||||
|
||||
$post = Post::selectFirstPost($fields, ['uri-id' => $uri_id]);
|
||||
|
@ -52,7 +52,7 @@ class History
|
|||
}
|
||||
|
||||
$update = false;
|
||||
$changed = DBStructure::getFieldsForTable('post-history', $item);
|
||||
$changed = DI::dbaDefinition()->getFieldsForTable('post-history', $item);
|
||||
unset($changed['uri-id']);
|
||||
unset($changed['edited']);
|
||||
foreach ($changed as $field => $content) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue