Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe JLinkedinCompanies
+ Graphe d'héritage de JLinkedinCompanies:
+ Graphe de collaboration de JLinkedinCompanies:

Liste de tous les membres

Fonctions membres publiques

 getCompanies ($id=null, $name=null, $domain=null, $fields=null)
 getUpdates ($id, $type=null, $count=0, $start=0)
 search ($fields=null, $keywords=null, $hq=false, $facets=null, $facet=null, $start=0, $count=0, $sort=null)
 getFollowed ($fields=null)
 follow ($id)
 unfollow ($id)
 getSuggested ($fields=null, $start=0, $count=0)
 getProducts ($id, $fields=null, $start=0, $count=0)
- Fonctions membres publiques inherited from JLinkedinObject
 __construct (JRegistry $options=null, JHttp $client=null, JLinkedinOAuth $oauth=null)
 booleanToString ($bool)
 getOption ($key)
 setOption ($key, $value)

Additional Inherited Members

- Attributs protégés inherited from JLinkedinObject
 $options
 $client
 $oauth

Description détaillée

Définition à la ligne 19 du fichier companies.php.


Documentation des fonctions membres

JLinkedinCompanies::follow (   $id)

Method to follow a company.

Paramètres:
string$idThe unique identifier for a company.
Renvoie:
array The decoded JSON response
Depuis:
13.1

Définition à la ligne 310 du fichier companies.php.

{
$token = $this->oauth->getToken();
// Set parameters.
$parameters = array(
'oauth_token' => $token['key']
);
// Set the success response code.
$this->oauth->setOption('success_code', 201);
// Set the API base
$base = '/v1/people/~/following/companies';
// Build xml.
$xml = '<company><id>' . $id . '</id></company>';
// Build the request path.
$path = $this->getOption('api.url') . $base;
$header['Content-Type'] = 'text/xml';
// Send the request.
$response = $this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header);
return $response;
}
JLinkedinCompanies::getCompanies (   $id = null,
  $name = null,
  $domain = null,
  $fields = null 
)

Method to retrieve companies using a company ID, a universal name, or an email domain.

Paramètres:
integer$idThe unique internal numeric company identifier.
string$nameThe unique string identifier for a company.
string$domainCompany email domains.
string$fieldsRequest fields beyond the default ones.
Renvoie:
array The decoded JSON response
Depuis:
13.1
Exceptions:
RuntimeException

Définition à la ligne 34 du fichier companies.php.

{
// At least one value is needed to retrieve data.
if ($id == null && $name == null && $domain == null)
{
// We don't have a valid entry
throw new RuntimeException('You must specify a company ID, a universal name, or an email domain.');
}
$token = $this->oauth->getToken();
// Set parameters.
$parameters = array(
'oauth_token' => $token['key']
);
// Set the API base
$base = '/v1/companies';
if ($id && $name)
{
$base .= '::(' . $id . ',universal-name=' . $name . ')';
}
elseif ($id)
{
$base .= '/' . $id;
}
elseif ($name)
{
$base .= '/universal-name=' . $name;
}
// Set request parameters.
$data['format'] = 'json';
if ($domain)
{
$data['email-domain'] = $domain;
}
// Check if fields is specified.
if ($fields)
{
$base .= ':' . $fields;
}
// Build the request path.
$path = $this->getOption('api.url') . $base;
// Send the request.
$response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data);
return json_decode($response->body);
}
JLinkedinCompanies::getFollowed (   $fields = null)

Method to get a list of companies the current member is following.

Paramètres:
string$fieldsRequest fields beyond the default ones.
Renvoie:
array The decoded JSON response
Depuis:
13.1

Définition à la ligne 272 du fichier companies.php.

{
$token = $this->oauth->getToken();
// Set parameters.
$parameters = array(
'oauth_token' => $token['key']
);
// Set the API base
$base = '/v1/people/~/following/companies';
$data['format'] = 'json';
// Check if fields is specified.
if ($fields)
{
$base .= ':' . $fields;
}
// Build the request path.
$path = $this->getOption('api.url') . $base;
// Send the request.
$response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data);
return json_decode($response->body);
}
JLinkedinCompanies::getProducts (   $id,
  $fields = null,
  $start = 0,
  $count = 0 
)

Method to get a collection of suggested companies for the current user.

Paramètres:
string$idThe unique identifier for a company.
string$fieldsRequest fields beyond the default ones.
integer$startStarting location within the result set for paginated returns.
integer$countThe number of results returned.
Renvoie:
array The decoded JSON response
Depuis:
13.1

Définition à la ligne 436 du fichier companies.php.

{
$token = $this->oauth->getToken();
// Set parameters.
$parameters = array(
'oauth_token' => $token['key']
);
// Set the API base
$base = '/v1/companies/' . $id . '/products';
$data['format'] = 'json';
// Check if fields is specified.
if ($fields)
{
$base .= ':' . $fields;
}
// Check if start is specified.
if ($start > 0)
{
$data['start'] = $start;
}
// Check if count is specified.
if ($count > 0)
{
$data['count'] = $count;
}
// Build the request path.
$path = $this->getOption('api.url') . $base;
// Send the request.
$response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data);
return json_decode($response->body);
}
JLinkedinCompanies::getSuggested (   $fields = null,
  $start = 0,
  $count = 0 
)

Method to get a collection of suggested companies for the current user.

Paramètres:
string$fieldsRequest fields beyond the default ones.
integer$startStarting location within the result set for paginated returns.
integer$countThe number of results returned.
Renvoie:
array The decoded JSON response
Depuis:
13.1

Définition à la ligne 383 du fichier companies.php.

{
$token = $this->oauth->getToken();
// Set parameters.
$parameters = array(
'oauth_token' => $token['key']
);
// Set the API base
$base = '/v1/people/~/suggestions/to-follow/companies';
$data['format'] = 'json';
// Check if fields is specified.
if ($fields)
{
$base .= ':' . $fields;
}
// Check if start is specified.
if ($start > 0)
{
$data['start'] = $start;
}
// Check if count is specified.
if ($count > 0)
{
$data['count'] = $count;
}
// Build the request path.
$path = $this->getOption('api.url') . $base;
// Send the request.
$response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data);
return json_decode($response->body);
}
JLinkedinCompanies::getUpdates (   $id,
  $type = null,
  $count = 0,
  $start = 0 
)

Method to read shares for a particular company .

Paramètres:
string$idThe unique company identifier.
string$typeAny valid Company Update Type from the table: https://developer.linkedin.com/reading-company-updates.
integer$countMaximum number of updates to return.
integer$startThe offset by which to start Network Update pagination.
Renvoie:
array The decoded JSON response
Depuis:
13.1

Définition à la ligne 101 du fichier companies.php.

{
$token = $this->oauth->getToken();
// Set parameters.
$parameters = array(
'oauth_token' => $token['key']
);
// Set the API base
$base = '/v1/companies/' . $id . '/updates';
// Set request parameters.
$data['format'] = 'json';
// Check if type is specified.
if ($type)
{
$data['event-type'] = $type;
}
// Check if count is specified.
if ($count > 0)
{
$data['count'] = $count;
}
// Check if start is specified.
if ($start > 0)
{
$data['start'] = $start;
}
// Build the request path.
$path = $this->getOption('api.url') . $base;
// Send the request.
$response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data);
return json_decode($response->body);
}
JLinkedinCompanies::search (   $fields = null,
  $keywords = null,
  $hq = false,
  $facets = null,
  $facet = null,
  $start = 0,
  $count = 0,
  $sort = null 
)

Method to search across company pages.

Paramètres:
string$fieldsRequest fields beyond the default ones.
string$keywordsMembers who have all the keywords anywhere in their profile.
boolean$hqMatching companies by the headquarters location. When this is set to "true" and a location facet is used, this restricts returned companies to only those whose headquarters resides in the specified location.
string$facetsFacet buckets to return, e.g. location.
array$facetArray of facet values to search over. Contains values for location, industry, network, company-size, num-followers-range and fortune, in exactly this order, null must be specified for an element if no value.
integer$startStarting location within the result set for paginated returns.
integer$countThe number of results returned.
string$sortControls the search result order. There are four options: relevance, relationship, followers and company-size.
Renvoie:
array The decoded JSON response
Depuis:
13.1

Définition à la ligne 162 du fichier companies.php.

{
$token = $this->oauth->getToken();
// Set parameters.
$parameters = array(
'oauth_token' => $token['key']
);
// Set the API base
$base = '/v1/company-search';
$data['format'] = 'json';
// Check if fields is specified.
if ($fields)
{
$base .= ':' . $fields;
}
// Check if keywords is specified.
if ($keywords)
{
$data['keywords'] = $keywords;
}
// Check if hq is true.
if ($hq)
{
$data['hq-only'] = $hq;
}
// Check if facets is specified.
if ($facets)
{
$data['facets'] = $facets;
}
// Check if facet is specified.
if ($facet)
{
$data['facet'] = array();
for ($i = 0; $i < count($facet); $i++)
{
if ($facet[$i])
{
if ($i == 0)
{
$data['facet'][] = 'location,' . $facet[$i];
}
if ($i == 1)
{
$data['facet'][] = 'industry,' . $facet[$i];
}
if ($i == 2)
{
$data['facet'][] = 'network,' . $facet[$i];
}
if ($i == 3)
{
$data['facet'][] = 'company-size,' . $facet[$i];
}
if ($i == 4)
{
$data['facet'][] = 'num-followers-range,' . $facet[$i];
}
if ($i == 5)
{
$data['facet'][] = 'fortune,' . $facet[$i];
}
}
}
}
// Check if start is specified.
if ($start > 0)
{
$data['start'] = $start;
}
// Check if count is specified.
if ($count > 0)
{
$data['count'] = $count;
}
// Check if sort is specified.
if ($sort)
{
$data['sort'] = $sort;
}
// Build the request path.
$path = $this->getOption('api.url') . $base;
// Send the request.
$response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data);
return json_decode($response->body);
}
JLinkedinCompanies::unfollow (   $id)

Method to unfollow a company.

Paramètres:
string$idThe unique identifier for a company.
Renvoie:
array The decoded JSON response
Depuis:
13.1

Définition à la ligne 348 du fichier companies.php.

{
$token = $this->oauth->getToken();
// Set parameters.
$parameters = array(
'oauth_token' => $token['key']
);
// Set the success response code.
$this->oauth->setOption('success_code', 204);
// Set the API base
$base = '/v1/people/~/following/companies/id=' . $id;
// Build the request path.
$path = $this->getOption('api.url') . $base;
// Send the request.
$response = $this->oauth->oauthRequest($path, 'DELETE', $parameters);
return $response;
}

La documentation de cette classe a été générée à partir du fichier suivant :