_type; } /** * @param string $value */ protected function _setType($value) { if ($value === null || $value === '') { throw new EmptyPropertyValueException( 'Empty value for "type" parameter in ConfirmationAttributes', 0, 'confirmationAttributes.type' ); } elseif (TypeCast::canCastToEnumString($value)) { if (ConfirmationType::valueExists($value)) { $this->_type = (string)$value; } else { throw new InvalidPropertyValueException( 'Invalid value for "type" parameter in ConfirmationAttributes', 0, 'confirmationAttributes.type', $value ); } } else { throw new InvalidPropertyValueTypeException( 'Invalid value type for "type" parameter in ConfirmationAttributes', 0, 'confirmationAttributes.type', $value ); } } /** * @return string */ public function getLocale() { return $this->_locale; } /** * @param string $value */ public function setLocale($value) { if ($value === null || $value === '') { $this->_locale = null; } elseif (!TypeCast::canCastToString($value)) { throw new InvalidPropertyValueTypeException( 'Invalid value type for "locale" parameter in ConfirmationAttributes', 0, 'confirmationAttributes.locale', $value ); } elseif (!preg_match('/^[a-z]{2}_[A-Z]{2}$/', (string)$value)) { throw new InvalidPropertyValueException( 'Invalid value type for "locale" parameter in ConfirmationAttributes', 0, 'confirmationAttributes.locale', $value ); } else { $this->_locale = (string)$value; } } }