class Braintree_MultipleValueNode in Commerce Braintree 7
Hierarchy
- class \Braintree_MultipleValueNode
Expanded class hierarchy of Braintree_MultipleValueNode
4 string references to 'Braintree_MultipleValueNode'
- Braintree_SubscriptionSearchTest::testSearch_ids_isMultipleValueNode in braintree_php/
tests/ unit/ SubscriptionSearchTest.php - Braintree_SubscriptionSearchTest::testSearch_inTrialPeriod_isMultipleValueNode in braintree_php/
tests/ unit/ SubscriptionSearchTest.php - Braintree_SubscriptionSearchTest::testSearch_merchantAccountId_isMultipleValueNode in braintree_php/
tests/ unit/ SubscriptionSearchTest.php - Braintree_SubscriptionSearchTest::testSearch_status_isMultipleValueNode in braintree_php/
tests/ unit/ SubscriptionSearchTest.php
File
- braintree_php/
lib/ Braintree/ MultipleValueNode.php, line 3
View source
class Braintree_MultipleValueNode {
function __construct($name, $allowedValues = array()) {
$this->name = $name;
$this->items = array();
$this->allowedValues = $allowedValues;
}
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;
}
function is($value) {
return $this
->in(array(
$value,
));
}
function toParam() {
return $this->items;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Braintree_MultipleValueNode:: |
function | |||
Braintree_MultipleValueNode:: |
function | 1 | ||
Braintree_MultipleValueNode:: |
function | 1 | ||
Braintree_MultipleValueNode:: |
function | 1 |