You are here

function Braintree_MultipleValueNode::in in Commerce Braintree 7

1 call to Braintree_MultipleValueNode::in()
Braintree_MultipleValueNode::is in braintree_php/lib/Braintree/MultipleValueNode.php

File

braintree_php/lib/Braintree/MultipleValueNode.php, line 12

Class

Braintree_MultipleValueNode

Code

function in($values) {
  $bad_values = array_diff($values, $this->allowedValues);
  if (count($this->allowedValues) > 0 && count($bad_values) > 0) {
    $message = 'Invalid argument(s) for ' . $this->name . ':';
    foreach ($bad_values as $bad_value) {
      $message .= ' ' . $bad_value;
    }
    throw new InvalidArgumentException($message);
  }
  $this->items = $values;
  return $this;
}