]> git.mxchange.org Git - friendica.git/blobdiff - src/BaseRepository.php
New page for remote follow requests
[friendica.git] / src / BaseRepository.php
index 30822091e1784f8e63842c47a465ea753a7686b8..cce1c50c17bc77f1cdc905a30297b8686f0c7b28 100644 (file)
@@ -122,7 +122,12 @@ abstract class BaseRepository extends BaseFactory
         */
        public function update(BaseModel $model)
        {
-               return $this->dba->update(static::$table_name, $model->toArray(), ['id' => $model->id], $model->getOriginalData());
+               if ($this->dba->update(static::$table_name, $model->toArray(), ['id' => $model->id], $model->getOriginalData())) {
+                       $model->resetOriginalData();
+                       return true;
+               }
+
+               return false;
        }
 
        /**
@@ -199,4 +204,12 @@ abstract class BaseRepository extends BaseFactory
 
                return $models;
        }
+
+       /**
+        * @param BaseCollection $collection
+        */
+       public function saveCollection(BaseCollection $collection)
+       {
+               $collection->map([$this, 'update']);
+       }
 }