| @@ 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( |
|
| @@ 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 find multiselect option value "%s" for attribute %s', |
|
| 81 | $val, |
|
| 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 | $val => array( |
|
| 93 | $this->raiseCounter($val), |
|
| 94 | array($this->getUniqueIdentifier() => true) |
|
| 95 | ) |
|
| 96 | ) |
|
| 97 | ) |
|
| 98 | ) |
|
| 99 | ); |
|
| 100 | ||
| 101 | // continue with the next option value |
|
| 102 | continue; |
|
| 103 | } |
|
| 104 | ||
| 105 | // throw an exception if the attribute is not available |
|
| 106 | throw new \Exception( |
|
| @@ 66-94 (lines=29) @@ | ||
| 63 | } |
|
| 64 | ||
| 65 | // query whether or not we're in debug mode |
|
| 66 | if ($this->isDebugMode()) { |
|
| 67 | // log a warning and return immediately |
|
| 68 | $this->getSystemLogger()->warning( |
|
| 69 | $this->appendExceptionSuffix( |
|
| 70 | sprintf( |
|
| 71 | 'Can\'t find select option value "%s" for attribute %s', |
|
| 72 | $attributeValue, |
|
| 73 | $attributeCode |
|
| 74 | ) |
|
| 75 | ) |
|
| 76 | ); |
|
| 77 | ||
| 78 | // add the missing option value to the registry |
|
| 79 | $this->mergeAttributesRecursive( |
|
| 80 | array( |
|
| 81 | RegistryKeys::MISSING_OPTION_VALUES => array( |
|
| 82 | $attributeCode => array( |
|
| 83 | $attributeValue => array( |
|
| 84 | $this->raiseCounter($attributeValue), |
|
| 85 | array($this->getUniqueIdentifier() => true) |
|
| 86 | ) |
|
| 87 | ) |
|
| 88 | ) |
|
| 89 | ) |
|
| 90 | ); |
|
| 91 | ||
| 92 | // return NULL, if the value can't be mapped to an option |
|
| 93 | return; |
|
| 94 | } |
|
| 95 | ||
| 96 | // throw an exception if the attribute is NOT |
|
| 97 | // available and we're not in debug mode |
|