]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/ItemDeliveryData.php
codeblock updates
[friendica.git] / src / Model / ItemDeliveryData.php
index e3be073e8e86bba0b53a594ca7709766405a0f75..1cd9c4f448acb897a8817bf507dfe05f12a6fdc1 100644 (file)
@@ -10,10 +10,13 @@ use Friendica\Database\DBA;
 
 class ItemDeliveryData
 {
-       const FIELD_LIST = [
+       const LEGACY_FIELD_LIST = [
                // Legacy fields moved from item table
                'postopts',
                'inform',
+       ];
+
+       const FIELD_LIST = [
                // New delivery fields with virtual field name in item fields
                'queue_count' => 'delivery_queue_count',
                'queue_done'  => 'delivery_queue_done',
@@ -28,7 +31,7 @@ class ItemDeliveryData
        public static function extractFields(array &$fields)
        {
                $delivery_data = [];
-               foreach (ItemDeliveryData::FIELD_LIST as $key => $field) {
+               foreach (array_merge(ItemDeliveryData::FIELD_LIST, ItemDeliveryData::LEGACY_FIELD_LIST) as $key => $field) {
                        if (is_int($key) && isset($fields[$field])) {
                                // Legacy field moved from item table
                                $delivery_data[$field] = $fields[$field];
@@ -50,6 +53,7 @@ class ItemDeliveryData
         *
         * @param integer $item_id
         * @return bool
+        * @throws \Exception
         */
        public static function incrementQueueDone($item_id)
        {
@@ -62,6 +66,7 @@ class ItemDeliveryData
         * @param integer $item_id
         * @param array   $fields
         * @return bool
+        * @throws \Exception
         */
        public static function insert($item_id, array $fields)
        {
@@ -82,6 +87,7 @@ class ItemDeliveryData
         * @param integer $item_id
         * @param array   $fields
         * @return bool
+        * @throws \Exception
         */
        public static function update($item_id, array $fields)
        {
@@ -102,6 +108,7 @@ class ItemDeliveryData
         *
         * @param integer $item_id
         * @return bool
+        * @throws \Exception
         */
        public static function delete($item_id)
        {