Skip to content

Commit

Permalink
Catch empty arrays
Browse files Browse the repository at this point in the history
Prevent empty nodes from rendering if there are no values
  • Loading branch information
EffectConnect committed Dec 9, 2019
1 parent 499e3ef commit fc06906
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion EffectConnectSDK/Core/Abstracts/ApiModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ public function getXml()
EffectConnectXMLElement::insert($xmlPayload, $modelValue);
} elseif (is_array($value))
{
if (count($value) === 0)
{
continue;
}
if ($this->isIterator())
{
foreach ($value as $parent => $list) {
Expand Down Expand Up @@ -127,4 +131,4 @@ protected function isIterator()
* @return string
*/
public abstract function getName();
}
}

0 comments on commit fc06906

Please sign in to comment.