/** * Update all the cleared post favorite counts */ private function updateFavoriteCounts($site_favorites) { foreach ($site_favorites['posts'] as $favorite) { $count_sync = new SyncFavoriteCount($favorite, 'inactive', $this->data['siteid']); $count_sync->sync(); } }
/** * Save the Favorite */ public function update($post_id, $status, $site_id) { $saveType = $this->settings_repo->saveType(); $usersync = new SyncSingleFavorite($post_id, $site_id); $usersync->{$saveType}(); $postsync = new SyncFavoriteCount($post_id, $status, $site_id); $postsync->sync(); }