]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/ItemDeliveryData.php
Adding REAMDEs to directories
[friendica.git] / src / Model / ItemDeliveryData.php
index fa69af84197a3d940fcc9dcdb865076b8f7a4a21..b1fd28e3cb19b181ade9c168d900b7bd41cb62f5 100644 (file)
@@ -7,6 +7,7 @@
 namespace Friendica\Model;
 
 use Friendica\Database\DBA;
+use \BadMethodCallException;
 
 class ItemDeliveryData
 {
@@ -31,7 +32,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];
@@ -53,6 +54,7 @@ class ItemDeliveryData
         *
         * @param integer $item_id
         * @return bool
+        * @throws \Exception
         */
        public static function incrementQueueDone($item_id)
        {
@@ -65,11 +67,12 @@ class ItemDeliveryData
         * @param integer $item_id
         * @param array   $fields
         * @return bool
+        * @throws \Exception
         */
        public static function insert($item_id, array $fields)
        {
                if (empty($item_id)) {
-                       throw new \BadMethodCallException('Empty item_id');
+                       throw new BadMethodCallException('Empty item_id');
                }
 
                $fields['iid'] = $item_id;
@@ -85,11 +88,12 @@ class ItemDeliveryData
         * @param integer $item_id
         * @param array   $fields
         * @return bool
+        * @throws \Exception
         */
        public static function update($item_id, array $fields)
        {
                if (empty($item_id)) {
-                       throw new \BadMethodCallException('Empty item_id');
+                       throw new BadMethodCallException('Empty item_id');
                }
 
                if (empty($fields)) {
@@ -105,11 +109,12 @@ class ItemDeliveryData
         *
         * @param integer $item_id
         * @return bool
+        * @throws \Exception
         */
        public static function delete($item_id)
        {
                if (empty($item_id)) {
-                       throw new \BadMethodCallException('Empty item_id');
+                       throw new BadMethodCallException('Empty item_id');
                }
 
                return DBA::delete('item-delivery-data', ['iid' => $item_id]);