public function stringToObject($data, $options = array())
	{
		if (is_object($data))
		{
			return $data;
		}

		$data = trim($data);

		// Try to parse, catching exception if it fails
		try
		{
			// Parse config string
			$parsed = SymfonyYaml::parse($data, true);
		}
		catch (Exception $e)
		{
			// Throw an exception Hubzero knows how to catch
			throw new ParseException(
				array(
					'message'   => 'Error parsing YAML',
					'exception' => $e,
				)
			);
		}

		if (!$parsed)
		{
			$parsed = '';
		}

		return (is_string($parsed) ? $parsed : $this->toObject($parsed));
	}
public function stringToObject($data, $options = array())
	{
		if (is_object($data))
		{
			return $data;
		}

		$data = trim($data);

		// Try to parse, catching exception if it fails
		try
		{
			// Parse config string
			$parsed = SymfonyYaml::parse($data, true);
		}
		catch (Exception $e)
		{
			// Throw an exception Hubzero knows how to catch
			throw new ParseException(
				array(
					'message'   => 'Error parsing YAML',
					'exception' => $e,
				)
			);
		}

		if (!$parsed)
		{
			$parsed = '';
		}

		return (is_string($parsed) ? $parsed : $this->toObject($parsed));
	}
public function stringToObject ( $ data , $ options = array ( ) ) { if ( is_object ( $ data ) ) { return $ data ; } $ data = trim ( $ data ) ; // Try to parse, catching exception if it fails try { // Parse config string $ parsed = SymfonyYaml :: parse ( $ data , true ) ; } catch ( Exception $ e ) { // Throw an exception Hubzero knows how to catch throw new ParseException ( array ( 'message' => 'Error parsing YAML' , 'exception' => $ e , ) ) ; } if ( ! $ parsed ) { $ parsed = '' ; } return ( is_string ( $ parsed ) ? $ parsed : $ this -> toObject ( $ parsed ) ) ; }
Parse a YAML formatted string and convert it into an object.

@param   string  $data     YAML formatted string to convert.
@param   array   $options  Options used by the formatter.
@return  object  Data object.
Parse a YAML formatted string and convert it into an object .