Companies you may want to follow.

Returns a list of companies the current user may want to follow, per:

http://developer.linkedin.com/docs/DOC-1324

@return arr
Array containing retrieval success, LinkedIn response.
167243
public function suggestedCompanies() {
	  // construct and send the request
    $query    = self::_URL_API . '/v1/people/~/suggestions/to-follow/companies';
	  $response = $this->fetch('GET', $query);
	  
	  /**
	   * Check for successful request (a 200 response from LinkedIn server) 
	   * per the documentation linked in method comments above.
	   */
	  return $this->checkResponse(200, $response);
	}
1300966
public function getResults(){
        $results = $this->get();
        if(!$results)
            return [];
        foreach($results as $index => $resultData){
            $return[$index]['location'] = implode(',',$resultData['geometry']['location']);
            $return[$index]['name'] = $resultData['name'];
            $return[$index]['vicinity'] = $resultData['vicinity'];
        }
        return $return;
    }
20678
public function getResults()
    {
        $list = (array) $this->parent->getAttributeFromArray($this->localKey);
        $result = [];

        foreach ($list as $index => $item) {
            $result[$index] = $model = $this->related->newInstance([], true);
            $model->setId($index);
        }

        return collect($result);
    }
365812
public function fetchArray()
	{
		if( isset( $this->rows[$this->cursor] ) )
		{
			$row = $this->rows[$this->cursor];
			return $row->getPairs();
		}
		else return FALSE;
	}
569092
public function getList()
    {
        $routeMatch = $this->getEvent()->getRouteMatch();
        $mode = $this->params('mode', false);
        $type = $this->params('type', false);
        $endpoint = $this->params('endpoint', false);
        $annee = $this->params('annee', 0);
        $processHandler = $this->getProcessStateHandler();
        $executions = $processHandler->getProcessExecutions($mode, $type, $endpoint, $annee);
        if ($executions instanceof \Doctrine\ORM\PersistentCollection)
            $executions = $executions->toArray();
        usort($executions, function (Execution $a, Execution $b)
        {
            return intval($a->getId()) < intval($b->getId());
        });
        $response = $this->getResponse();
        $response->getHeaders()->addHeaderLine('Content-Type', 'application/json');
        $serializer = $this->getSerializer();
        $processJson = $serializer->serialize($executions, 'json');
        $response->setContent($processJson);
        return $response;
    }
568150
public function toArray() {
        $return = array();
        $this->links->setIteratorMode(\SplDoublyLinkedList::IT_MODE_FIFO);
        for($this->links->rewind(); $this->links->valid(); $this->links->next()) {
            $return[] = $this->links->current();
        }
        return $return;
    }
703856
public function actionFollow()
    {
        Yii::$app->response->format = Response::FORMAT_JSON;
        $id = Yii::$app->request->post('id', null);
        if (($model = Tag::findOne(['id' => $id])) != null) {
            /** @var \yuncms\user\models\User $user */
            $user = Yii::$app->user->identity;
            if ($user->hasTagValues($model->id)) {
                $user->removeTagValues($model->id);
                $user->save();
                //Yii::$app->response->setStatusCode(204);
                return ['status' => 'unfollowed'];
            } else {
                $user->addTagValues($model->id);
                $user->save();
                //Yii::$app->response->setStatusCode(200);
                return ['status' => 'followed'];
            }
        } else {
            throw new NotFoundHttpException ();
        }
    }
1243181
private function getLinkList()
    {
        $linkList = [];

        foreach ($this->configurator->getSocialNetworks() as $key => $socialNetwork) {
            if (isset($socialNetwork['class'])) {
                $linkOptions = $this->combineOptions($socialNetwork);
                $linkOptions['href'] = $this->createDriver($socialNetwork)->getLink();
                $linkList[] = Html::tag('a', $this->getLinkLabel($socialNetwork, Inflector::camel2words($key)), $linkOptions);
            }
        }

        return $linkList;
    }
150180
public function getList()
    {
        $sites = $this->siteManager->findAll();
        $this->addPaginationData($sites);
        $sites = $sites->getItems();
        if (empty($sites)) {
            $this->addInfoMessage(self::INFO_NO_ENTRIES_FOUND);
        }
        return $sites;
    }
145840
public function retrieveTokenRequest(array $scope = array()) {
    $parameters = array(
      'oauth_callback' => $this->getCallbackUrl()
    );

    $requestUrl = self::_URL_REQUEST;

    if (!empty($scope)) {
        $requestUrl .= '?scope=' . implode('+', $scope);
    }

    $response = $this->fetch(self::_METHOD_TOKENS, $requestUrl, NULL, $parameters);
    parse_str($response['linkedin'], $response['linkedin']);
    
    /**
	   * Check for successful request (a 200 response from LinkedIn server) 
	   * per the documentation linked in method comments above.
	   */
    if(($response['info']['http_code'] == 200) && (array_key_exists('oauth_callback_confirmed', $response['linkedin'])) && ($response['linkedin']['oauth_callback_confirmed'] == 'true')) {
      // tokens retrieved
      $this->setToken($response['linkedin']);
      
      // set the response
      $return_data            = $response;
      $return_data['success'] = TRUE;        
    } else {
      // error getting the request tokens
      $this->setToken(NULL);
      
      // set the response
      $return_data = $response;
      if((array_key_exists('oauth_callback_confirmed', $response['linkedin'])) && ($response['linkedin']['oauth_callback_confirmed'] == 'true')) {
        $return_data['error'] = 'HTTP response from LinkedIn end-point was not code 200';
      } else {
        $return_data['error'] = 'OAuth callback URL was not confirmed by the LinkedIn end-point';
      }
      $return_data['success'] = FALSE;
    }
    return $return_data;
	}
1343419
protected function generateFollowCounts() {

		$returnArr = [
			IFollower::TYPE_LIKE => [ 0 => 0, 1 => 0 ],
			IFollower::TYPE_DISLIKE => [ 0 => 0, 1 => 0 ],
			IFollower::TYPE_FOLLOW => [ 0 => 0, 1 => 0 ],
			IFollower::TYPE_WISHLIST => [ 0 => 0, 1 => 0 ]
		];

		$followerTable	= ModelFollower::tableName();
		$query			= new Query();

    	$query->select( [ 'type', 'active', 'count(id) as total' ] )
				->from( $followerTable )
				->where( [ 'parentId' => $this->id, 'parentType' => $this->modelType, 'active' => true ] )
				->groupBy( [ 'type', 'active' ] );

		$counts = $query->all();

		foreach( $counts as $count ) {

			$returnArr[ $count[ 'type' ] ][ $count[ 'active' ] ] = $count[ 'total' ];
		}

		return $returnArr;
	}
657489
public function bookmarkedJobs() {	
    // construct and send the request  
	  $query    = self::_URL_API . '/v1/people/~/job-bookmarks';
	  $response = $this->fetch('GET', $query);
	  
	  /**
	   * Check for successful request (a 200 response from LinkedIn server) 
	   * per the documentation linked in method comments above.
	   */
		return $this->checkResponse(200, $response);
	}
440012
def get_companies():
        
        LOGGER.debug("CompanyService.get_companies")
        args = {'http_operation': 'GET', 'operation_path': ''}
        response = CompanyService.requester.call(args)
        ret = None
        if response.rc == 0:
            ret = []
            for company in response.response_content['companies']:
                ret.append(Company.json_2_company(company))
        elif response.rc != 404:
            err_msg = 'CompanyService.get_companies - Problem while getting companies. ' \
                      'Reason: ' + str(response.response_content) + '-' + str(response.error_message) + \
                      " (" + str(response.rc) + ")"
            LOGGER.warning(err_msg)
        return ret
602773
public function bookmarkers()
    {
        return $this->morphToMany(config('follow.user_model'), config('follow.morph_prefix'), config('follow.followable_table'))
                    ->wherePivot('relation', '=', Follow::RELATION_BOOKMARK)
                    ->withPivot('followable_type', 'relation', 'created_at');
    }
995623
public function getList()
    {
        $routeMatch = $this->getEvent()->getRouteMatch();
        
        $type = $this->params('type', false);
        
        $alerts = $this->getAlertDataHandler()->getAlertsStructure($type);
        $response = $this->getResponse();
        $response->getHeaders()->addHeaderLine('Content-Type', 'application/json');
        $serializer = $this->getSerializer();
        $alertssJson = $serializer->serialize($alerts, 'json');
        $response->setContent($alertssJson);
        return $response;
    }
1217155
public function getAnchors()
    {
        $list = ArrayList::create();
        
        if ($page = $this->getCurrentPage(Page::class)) {
            
            $html = HTMLValue::create($page->Content);
            
            $anchors = $html->query("//*[@id]");
            
            foreach ($anchors as $anchor) {
                
                $list->push(
                    ArrayData::create([
                        'Link' => $page->Link(sprintf('#%s', $anchor->getAttribute('id'))),
                        'Text' => $anchor->textContent
                    ])
                );
                
            }
            
        }
        
        return $list;
    }
885646
public function actionIndex()
    {
        
        if($this->searchClass === null){
            $searchModel = new AssigmentSearch;
        }  else {
            $class = $this->searchClass;
            $searchModel = new $class;
        }       

        $dataProvider = $searchModel->search(\Yii::$app->request->getQueryParams(), $this->userClassName, $this->usernameField);
        return $this->render('index', [
                'dataProvider' => $dataProvider,
                'searchModel' => $searchModel,
                'idField' => $this->idField,
                'usernameField' => $this->usernameField,
        ]);
    }