| @@ 75-103 (lines=29) @@ | ||
| 72 | } |
|
| 73 | ||
| 74 | // query whether or not we're in debug mode |
|
| 75 | if ($this->isDebugMode()) { |
|
| 76 | // log a warning and continue with the next value |
|
| 77 | $this->getSystemLogger()->warning( |
|
| 78 | $this->appendExceptionSuffix( |
|
| 79 | sprintf( |
|
| 80 | 'Can\'t map option value "%s" for attribute %s to a boolean representation', |
|
| 81 | $attributeValue, |
|
| 82 | $attributeCode |
|
| 83 | ) |
|
| 84 | ) |
|
| 85 | ); |
|
| 86 | ||
| 87 | // add the missing option value to the registry |
|
| 88 | $this->mergeAttributesRecursive( |
|
| 89 | array( |
|
| 90 | RegistryKeys::MISSING_OPTION_VALUES => array( |
|
| 91 | $attributeCode => array( |
|
| 92 | $attributeValue => array( |
|
| 93 | $this->raiseCounter($attributeValue), |
|
| 94 | array($this->getUniqueIdentifier() => true) |
|
| 95 | ) |
|
| 96 | ) |
|
| 97 | ) |
|
| 98 | ) |
|
| 99 | ); |
|
| 100 | ||
| 101 | // return NULL, if NO value can be mapped to a boolean representation |
|
| 102 | return; |
|
| 103 | } |
|
| 104 | ||
| 105 | // throw an exception if the attribute is not available |
|
| 106 | throw new \Exception( |
|
| @@ 93-121 (lines=29) @@ | ||
| 90 | } |
|
| 91 | ||
| 92 | // query whether or not we're in debug mode |
|
| 93 | if ($this->isDebugMode()) { |
|
| 94 | // log a warning and continue with the next value |
|
| 95 | $this->getSystemLogger()->warning( |
|
| 96 | $this->appendExceptionSuffix( |
|
| 97 | sprintf( |
|
| 98 | 'Can\'t find multiselect option value "%s" for attribute %s', |
|
| 99 | $val, |
|
| 100 | $attributeCode |
|
| 101 | ) |
|
| 102 | ) |
|
| 103 | ); |
|
| 104 | ||
| 105 | // add the missing option value to the registry |
|
| 106 | $this->mergeAttributesRecursive( |
|
| 107 | array( |
|
| 108 | RegistryKeys::MISSING_OPTION_VALUES => array( |
|
| 109 | $attributeCode => array( |
|
| 110 | $val => array( |
|
| 111 | $this->raiseCounter($val), |
|
| 112 | array($this->getUniqueIdentifier() => true) |
|
| 113 | ) |
|
| 114 | ) |
|
| 115 | ) |
|
| 116 | ) |
|
| 117 | ); |
|
| 118 | ||
| 119 | // continue with the next option value |
|
| 120 | continue; |
|
| 121 | } |
|
| 122 | ||
| 123 | // throw an exception if the attribute is not available |
|
| 124 | throw new \Exception( |
|
| @@ 84-112 (lines=29) @@ | ||
| 81 | } |
|
| 82 | ||
| 83 | // query whether or not we're in debug mode |
|
| 84 | if ($this->isDebugMode()) { |
|
| 85 | // log a warning and return immediately |
|
| 86 | $this->getSystemLogger()->warning( |
|
| 87 | $this->appendExceptionSuffix( |
|
| 88 | sprintf( |
|
| 89 | 'Can\'t find select option value "%s" for attribute %s', |
|
| 90 | $attributeValue, |
|
| 91 | $attributeCode |
|
| 92 | ) |
|
| 93 | ) |
|
| 94 | ); |
|
| 95 | ||
| 96 | // add the missing option value to the registry |
|
| 97 | $this->mergeAttributesRecursive( |
|
| 98 | array( |
|
| 99 | RegistryKeys::MISSING_OPTION_VALUES => array( |
|
| 100 | $attributeCode => array( |
|
| 101 | $attributeValue => array( |
|
| 102 | $this->raiseCounter($attributeValue), |
|
| 103 | array($this->getUniqueIdentifier() => true) |
|
| 104 | ) |
|
| 105 | ) |
|
| 106 | ) |
|
| 107 | ) |
|
| 108 | ); |
|
| 109 | ||
| 110 | // return NULL, if the value can't be mapped to an option |
|
| 111 | return; |
|
| 112 | } |
|
| 113 | ||
| 114 | // throw an exception if the attribute is NOT |
|
| 115 | // available and we're not in debug mode |
|