dnzengou / simple-linkedinphp

Automatically exported from code.google.com/p/simple-linkedinphp
0 stars 0 forks source link

New method needed: companyUpdates() #22

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Below is the code I patched into v3.1.1 to get this feed. Documented at 
<https://developer.linkedin.com/reading-company-updates>.

---

    public function companyUpdates($options, $by_email = FALSE) {
      // check passed data
      if(!is_string($options)) {
        // bad data passed
          throw new LinkedInException('LinkedIn->company(): bad data passed, $options must be of type string.');
      }
      if(!is_bool($by_email)) {
        // bad data passed
          throw new LinkedInException('LinkedIn->company(): bad data passed, $by_email must be of type boolean.');
      }

      // construct and send the request
      $query    = self::_URL_API . '/v1/companies' . ($by_email ? '' : '/') . trim($options) . '/updates';
      $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);

    }

Original issue reported on code.google.com by stephen....@gmail.com on 4 Feb 2012 at 5:15

GoogleCodeExporter commented 8 years ago
Would it be possible to post company updates for designated company admins.
I am using version 3.2.0 and would be happy to test on my install both on local 
host and on a remote development server.

Original comment by pe...@compareholidaymoney.com on 23 Apr 2012 at 8:08