src/Identity/SocialRecordManager.php
public static function importSocialRecord($source)
	{
		$json = new JSONObject($source);
		
		$socialRecord = SocialRecordBuilder::buildFromJSON($json->get('socialRecord'));
		
		$result = array('socialRecord' => $socialRecord);
		
		if($json->has('accountPrivateKey'))
			$result['accountKeyPair'] = new KeyPair($json->get('accountPrivateKey'), $socialRecord->getAccountPublicKey());
		if($json->has('personalPrivateKey'))
			$result['personalKeyPair'] = new KeyPair($json->get('personalPrivateKey'), $socialRecord->getPersonalPublicKey());
		
		return $result;
	}
public static function importSocialRecord($source)
	{
		$json = new JSONObject($source);
		
		$socialRecord = SocialRecordBuilder::buildFromJSON($json->get('socialRecord'));
		
		$result = array('socialRecord' => $socialRecord);
		
		if($json->has('accountPrivateKey'))
			$result['accountKeyPair'] = new KeyPair($json->get('accountPrivateKey'), $socialRecord->getAccountPublicKey());
		if($json->has('personalPrivateKey'))
			$result['personalKeyPair'] = new KeyPair($json->get('personalPrivateKey'), $socialRecord->getPersonalPublicKey());
		
		return $result;
	}
public static function importSocialRecord ( $ source ) { $ json = new JSONObject ( $ source ) ; $ socialRecord = SocialRecordBuilder :: buildFromJSON ( $ json -> get ( 'socialRecord' ) ) ; $ result = array ( 'socialRecord' => $ socialRecord ) ; if ( $ json -> has ( 'accountPrivateKey' ) ) $ result [ 'accountKeyPair' ] = new KeyPair ( $ json -> get ( 'accountPrivateKey' ) , $ socialRecord -> getAccountPublicKey ( ) ) ; if ( $ json -> has ( 'personalPrivateKey' ) ) $ result [ 'personalKeyPair' ] = new KeyPair ( $ json -> get ( 'personalPrivateKey' ) , $ socialRecord -> getPersonalPublicKey ( ) ) ; return $ result ; }
Imports a SocialRecord from a string resource

@param $source The string to parse
@return array Array containting the SocialRecord object and optinally the KeyPair(s)
Imports a SocialRecord from a string resource