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;
	
	}
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;
	
	}
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 ; }
Private utility for casting to proper type.

@param	mixed	The variable value.
@param	string	the variable type (text, int, bool, custom, list).

@return	mixed
Private utility for casting to proper type .