Merge pull request #57 from jchamberlain/custom-data

Allow any data type for custom data
This commit is contained in:
Travis Swientek 2014-11-17 17:25:43 -08:00
commit 24085530d9

View File

@ -314,15 +314,7 @@ class MessageBuilder
public function addCustomData($customName, $data) public function addCustomData($customName, $data)
{ {
if (is_array($data)) { $this->message['v:' . $customName] = json_encode($data);
$jsonArray = json_encode($data);
$this->message['v:' . $customName] = $jsonArray;
return $this->message['v:' . $customName];
} else {
throw new InvalidParameter(INVALID_PARAMETER_NON_ARRAY);
}
} }
public function addCustomParameter($parameterName, $data) public function addCustomParameter($parameterName, $data)