public function getValidValue($value)
{
if (is_object($value)) {
$thisClass = strtolower(get_class($this));
$valClass = strtolower(get_class($value));
if ($thisClass !== $valClass) {
throw new Exception($this->_type . ': No valid object type given: ' . $valClass);
}
} else {
$className = get_class($this);
$value = new $className($value, $this->_getConfig());
}
return $value;
}