From 81925e37300e666d0b7efef997f9177b5e4fdfd4 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 9 Jan 2018 21:13:45 +0000 Subject: [PATCH] We now are having an item class and a method to change item entries --- mod/item.php | 8 ++----- src/Model/Item.php | 56 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 6 deletions(-) create mode 100644 src/Model/Item.php diff --git a/mod/item.php b/mod/item.php index 8426c2d2ba..5d9ca81996 100644 --- a/mod/item.php +++ b/mod/item.php @@ -21,6 +21,7 @@ use Friendica\Core\Worker; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\GContact; +use Friendica\Model\Item; use Friendica\Network\Probe; use Friendica\Protocol\Diaspora; use Friendica\Protocol\Email; @@ -820,16 +821,11 @@ function item_post(App $a) { 'edited' => datetime_convert(), 'changed' => datetime_convert()); - dba::update('item', $fields, ['id' => $post_id]); - - create_tags_from_item($post_id); - create_files_from_item($post_id); - update_thread($post_id); + Item::update($fields, ['id' => $post_id]); // update filetags in pconfig file_tag_update_pconfig($uid,$categories_old,$categories_new,'category'); - Worker::add(PRIORITY_HIGH, "Notifier", 'edit_post', $post_id); if (x($_REQUEST, 'return') && strlen($return_path)) { logger('return: ' . $return_path); goaway($return_path); diff --git a/src/Model/Item.php b/src/Model/Item.php new file mode 100644 index 0000000000..c65e8f1aab --- /dev/null +++ b/src/Model/Item.php @@ -0,0 +1,56 @@ +