Skip to content

Commit

Permalink
Fixed #5: Set identifier_exists property
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalybaev committed Nov 7, 2018
1 parent ceb3f7a commit ff968a9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,24 @@ public function setMpn($mpn)
return $this;
}

/**
* Sets identifier_exists code of the product. (yes / no)
*
* @param string $identifierExists
*
* @return $this
* @throws InvalidArgumentException
*/
public function setIdentifierExists($identifierExists)
{
$identifierExists = strtolower($identifierExists);
if (!in_array($identifierExists, ['yes', 'no'])) {
throw new InvalidArgumentException("identifier_exists property should be one of 'yes' or 'no'");
}
$this->setAttribute('identifier_exists', $identifierExists, false);
return $this;
}

/**
* Sets condition of the product.
*
Expand Down

0 comments on commit ff968a9

Please sign in to comment.