Skip to content

Commit

Permalink
Merge pull request #37 from 5zymon/master
Browse files Browse the repository at this point in the history
fixing cloneit method, so it actually uses exising method instead of …
  • Loading branch information
lukesnowden authored Nov 5, 2018
2 parents 71cc404 + 7e9d475 commit 9792555
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/LukeSnowden/GoogleShoppingFeed/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -480,12 +480,12 @@ public function cloneIt()
}
}
} elseif ($node->get('name') !== 'shipping') {
if (method_exists($item->{$node->get('name')})) {
if (method_exists($item, $node->get('name'))) {
$item->{$node->get('name')}($node->get('value'));
return $item;
continue;
}

if (!method_exists($item->{$node->get('name')})) {
if (!method_exists($item, $node->get('name'))) {
$item->custom($node->get('name'), ($node->get('value')));
}
}
Expand Down

0 comments on commit 9792555

Please sign in to comment.