private function update3500CronJob($data, $processData) { $friends = OW::getEventManager()->call('plugin.friends.find_all_active_friendships'); foreach ($friends as $f) { $this->service->addFollow((int) $f->userId, 'user', (int) $f->friendId, 'friends_only'); $this->service->addFollow((int) $f->friendId, 'user', (int) $f->userId, 'friends_only'); } return true; }
public function addFollow(OW_Event $e) { $params = $e->getParams(); $this->validateParams($params, array('feedType', 'feedId', 'userId')); $event = new BASE_CLASS_EventCollector('feed.collect_follow_permissions', $params); OW::getEventManager()->trigger($event); $data = $event->getData(); $type = empty($data) ? NEWSFEED_BOL_Service::PRIVACY_EVERYBODY : end($data); // TODO to remove the stub $this->service->addFollow($params['userId'], $params['feedType'], $params['feedId'], $type); }