Example #1
0
 /**
  * @return array|null
  */
 public function getGroups()
 {
     if (!is_object(self::$object)) {
         self::$object = new SJB_LinkedIn();
     }
     if (self::$object->_getAccessToken()) {
         $groups = self::$object->getGroups();
         if ($groups) {
             $groupValues = array();
             foreach ($groups->{'group-membership'} as $groupMembership) {
                 $group = $groupMembership->group;
                 $groupsList[(string) $group->id] = (string) $group->name;
             }
             if (!empty($groupsList)) {
                 asort($groupsList, SORT_STRING);
                 foreach ($groupsList as $groupID => $groupName) {
                     $groupValues[] = array('id' => $groupID, 'caption' => $groupName);
                 }
                 return $groupValues;
             }
         }
     }
     return null;
 }
Example #2
0
 /**
  * @param SJB_LinkedInSocial $feed
  * @param string $action
  */
 public function saveFeed($feed, $action = '')
 {
     parent::saveFeed($feed);
     $linkedInSocialMedia = new SJB_LinkedInSocialMedia();
     $linkedInSocialMedia->saveAccountInfo($feed->getSID(), $feed->getPropertyValue('account_id'));
 }