Example #1
0
 /**
  * returns the matching PostApiClient
  *
  * @author Matthias Pfefferle
  * @param mixed $pCommunity the community name or the community id
  * @param array $pParams
  * @return Object
  */
 public static function factory($pCommunity, $pParams = null)
 {
     // check if $pCommunity is the name or the id
     if (is_numeric($pCommunity)) {
         $lCommunityObject = CommunityTable::getInstance()->retrieveByPk($pCommunity);
         $lCommunity = $lCommunityObject->getCommunity();
     } else {
         $lCommunity = $pCommunity;
     }
     // return matching object
     switch ($lCommunity) {
         case "facebook":
             return new FacebookImportClient();
             break;
         case "twitter":
             return new TwitterImportClient();
             break;
         case "linkedin":
             return new LinkedinImportClient();
             break;
         case "xing":
             return new XingImportClient();
             break;
         case "tumblr":
             return new TumblrImportClient();
             break;
         case "flattr":
             return new FlattrImportClient();
             break;
         default:
             return null;
     }
 }
 /**
  * get all communitys which support social publishing
  *
  * @author weyandch
  */
 public static function retrieveCommunitysForSocialPublishing()
 {
     $lReturn = array();
     $lCommunityIds = self::retrieveCommunityIdsForSocialPublishing();
     foreach ($lCommunityIds as $id) {
         $lReturn[] = CommunityTable::getInstance()->retrieveByPK($id);
     }
     return $lReturn;
 }
 public function testGetIdentitysConnectedToOi()
 {
     $lCommunity = CommunityTable::getInstance()->findBy("community", "google");
     $lCommunity = $lCommunity[0];
     $result = OnlineIdentityTable::retrieveByIdentifier("hugo", $lCommunity->getId(), OnlineIdentityTable::TYPE_IDENTITY);
     $this->assertEquals("hugo", $result->getIdentifier());
     $lConnectedIds = OnlineIdentityConTable::getIdentitysConnectedToOi($result->getId());
     $this->assertTrue(is_array($lConnectedIds));
     $this->assertEquals('OnlineIdentity', get_class(OnlineIdentityTable::getInstance()->find($lConnectedIds[0])));
 }
 public function getCommunity()
 {
     return CommunityTable::getInstance()->retrieveByPk($this->getCommunityId());
 }
Example #5
0
 /**
  * get matching community-object
  *
  * @author Matthias Pfefferle
  * @return Community
  */
 public function getCommunity()
 {
     $lCommunity = CommunityTable::getInstance()->retrieveByPk($this->aCommunityId);
     return $lCommunity;
 }