system/View/Parser.php
protected function objectToArray($value)
	{
		// Objects that have a `toArray()` method should be
		// converted with that method (i.e. Entities)
		if (is_object($value) && method_exists($value, 'toArray'))
		{
			$value = $value->toArray();
		}
		// Otherwise, cast as an array and it will grab public properties.
		else if (is_object($value))
		{
			$value = (array)$value;
		}

		return $value;
	}
protected function objectToArray($value)
	{
		// Objects that have a `toArray()` method should be
		// converted with that method (i.e. Entities)
		if (is_object($value) && method_exists($value, 'toArray'))
		{
			$value = $value->toArray();
		}
		// Otherwise, cast as an array and it will grab public properties.
		else if (is_object($value))
		{
			$value = (array)$value;
		}

		return $value;
	}
Converts an object to an array, respecting any
toArray() methods on an object.

@param $value

@return mixed