예제 #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;
     }
 }
예제 #2
0
 /**
  * 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;
 }
예제 #3
0
 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])));
 }
예제 #4
0
 public function getCommunity()
 {
     return CommunityTable::getInstance()->retrieveByPk($this->getCommunityId());
 }
예제 #5
0
 /**
  * get matching community-object
  *
  * @author Matthias Pfefferle
  * @return Community
  */
 public function getCommunity()
 {
     $lCommunity = CommunityTable::getInstance()->retrieveByPk($this->aCommunityId);
     return $lCommunity;
 }