public function dump($depth = 3, \SplObjectStorage $dumped = null)
	{
		// Check if we should initialise the recursion tracker.
		if ($dumped === null)
		{
			$dumped = new \SplObjectStorage;
		}

		// Add this object to the dumped stack.
		$dumped->attach($this);

		$objects = array();

		// Make sure that we have not reached our maximum depth.
		if ($depth > 0)
		{
			// Handle JSON serialization recursively.
			foreach ($this->objects as $key => $object)
			{
				$objects[$key] = $object->dump($depth, $dumped);
			}
		}

		return $objects;
	}
public function dump($depth = 3, \SplObjectStorage $dumped = null)
	{
		// Check if we should initialise the recursion tracker.
		if ($dumped === null)
		{
			$dumped = new \SplObjectStorage;
		}

		// Add this object to the dumped stack.
		$dumped->attach($this);

		$objects = array();

		// Make sure that we have not reached our maximum depth.
		if ($depth > 0)
		{
			// Handle JSON serialization recursively.
			foreach ($this->objects as $key => $object)
			{
				$objects[$key] = $object->dump($depth, $dumped);
			}
		}

		return $objects;
	}
public function dump ( $ depth = 3 , \ SplObjectStorage $ dumped = null ) { // Check if we should initialise the recursion tracker. if ( $ dumped === null ) { $ dumped = new \ SplObjectStorage ; } // Add this object to the dumped stack. $ dumped -> attach ( $ this ) ; $ objects = array ( ) ; // Make sure that we have not reached our maximum depth. if ( $ depth > 0 ) { // Handle JSON serialization recursively. foreach ( $ this -> objects as $ key => $ object ) { $ objects [ $ key ] = $ object -> dump ( $ depth , $ dumped ) ; } } return $ objects ; }
Dumps the data object in the set, recursively if appropriate.

@param   integer            $depth   The maximum depth of recursion (default = 3).
For example, a depth of 0 will return a stdClass with all the properties in native
form. A depth of 1 will recurse into the first level of properties only.
@param   \SplObjectStorage  $dumped  An array of already serialized objects that is used to avoid infinite loops.

@return  array  An associative array of the data objects in the set, dumped as a simple PHP stdClass object.

@see     DataObject::dump()
@since   1.0
Dumps the data object in the set recursively if appropriate .