BraintreeMultipleValueNode

The Paid Memberships Pro Braintree MultipleValueNode class.

Defined (1)

The class is defined in the following location(s).

/includes/lib/Braintree/lib/Braintree/MultipleValueNode.php  
  1. class MultipleValueNode 
  2. public function __construct($name, $allowedValues = []) 
  3. $this->name = $name; 
  4. $this->items = []; 
  5. $this->allowedValues = $allowedValues; 
  6.  
  7. public function in($values) 
  8. $bad_values = array_diff($values, $this->allowedValues); 
  9. if (count($this->allowedValues) > 0 && count($bad_values) > 0) { 
  10. $message = 'Invalid argument(s) for ' . $this->name . ':'; 
  11. foreach ($bad_values AS $bad_value) { 
  12. $message .= ' ' . $bad_value; 
  13.  
  14. throw new InvalidArgumentException($message); 
  15.  
  16. $this->items = $values; 
  17. return $this; 
  18.  
  19. public function is($value) 
  20. return $this->in([$value]); 
  21.  
  22. public function toParam() 
  23. return $this->items;