Ejemplo n.º 1
0
 /**
  * Sends a SocialRecord to the GSLS. The SocialRecord is updated/overwritten if it already exists. Otherwise, the
  * new SocialRecord is stored. In case of a failed ateempt to (over-)write a SocialRecord, an Exception is thrown.
  * 
  * @param $entityAuthData EntityAuthData The EntityAuthData object for the SocialRecord to be pushed. The personal
  * key pair must be configured
  */
 public static function pushToGSLS(EntityAuthData $entityAuthData)
 {
     if ($entityAuthData->getPersonalKeyPair() == NULL) {
         throw new \Exception('SocialRecord can only be pushed with PersonalKeyPair configured');
     }
     if (SocialRecordManager::socialRecordExists($entityAuthData->getGlobalID())) {
         GSLS::putSocialRecord($entityAuthData->getSocialRecord(), $entityAuthData->getPersonalKeyPair()->getPrivateKey());
     } else {
         GSLS::postSocialRecord($entityAuthData->getSocialRecord(), $entityAuthData->getPersonalKeyPair()->getPrivateKey());
     }
 }