private function castTo($value, $type) {
	
		switch ($type) {
	
			default:
				$value = (string)$value;
				break;
				
			case 'int':
				$value = (int)$value;
				break;
				
			case 'bool':
				$value = (bool)$value;
				break;
				
			case 'password':
				if ($this->isCryptAvailable()) {
					$value = openssl_decrypt($value, 'AES128', OPTIONS_CRYPT_KEY);
				} else {
					$app = Application::getInstance();
					$app->logWarning('OPTIONS_CRYPT_KEY constant should be defined into config.php file.');
				}
				break;
				
			case 'list':
				break;
				
		}
		
		return $value;
	
	}