public function gatherElementsFromType( $type )
	{
		if ( is_string( $type ) )
		{
			$type = $this->getType( $type );
		}

		if ( ! is_array( $type ) ) return false;

		$elements = array();

		foreach ( array( 'elements', 'sequence', 'choice', 'group' ) as $typeComponent )
		{
			if ( ! isset( $type[ $typeComponent ] ) )
			{
				continue;
			}

			foreach ( $type[ $typeComponent ] as $id => $element )
			{
				if ( $id == 'restrictionType')
				{
					continue;
				}

				if ( $id == 'elements' )
				{
					$elements += $element;
					continue;
				}

				$result = $this->gatherElementsFromType( $element );
				if ( ! $result )
				{
					$elements[ "{$element['prefix']}:{$element['name']}" ] = $element;
				}

				$elements += $result;
			}

		}

		return $elements;
	}
public function gatherElementsFromType( $type )
	{
		if ( is_string( $type ) )
		{
			$type = $this->getType( $type );
		}

		if ( ! is_array( $type ) ) return false;

		$elements = array();

		foreach ( array( 'elements', 'sequence', 'choice', 'group' ) as $typeComponent )
		{
			if ( ! isset( $type[ $typeComponent ] ) )
			{
				continue;
			}

			foreach ( $type[ $typeComponent ] as $id => $element )
			{
				if ( $id == 'restrictionType')
				{
					continue;
				}

				if ( $id == 'elements' )
				{
					$elements += $element;
					continue;
				}

				$result = $this->gatherElementsFromType( $element );
				if ( ! $result )
				{
					$elements[ "{$element['prefix']}:{$element['name']}" ] = $element;
				}

				$elements += $result;
			}

		}

		return $elements;
	}
public function gatherElementsFromType ( $ type ) { if ( is_string ( $ type ) ) { $ type = $ this -> getType ( $ type ) ; } if ( ! is_array ( $ type ) ) return false ; $ elements = array ( ) ; foreach ( array ( 'elements' , 'sequence' , 'choice' , 'group' ) as $ typeComponent ) { if ( ! isset ( $ type [ $ typeComponent ] ) ) { continue ; } foreach ( $ type [ $ typeComponent ] as $ id => $ element ) { if ( $ id == 'restrictionType' ) { continue ; } if ( $ id == 'elements' ) { $ elements += $ element ; continue ; } $ result = $ this -> gatherElementsFromType ( $ element ) ; if ( ! $ result ) { $ elements [ "{$element['prefix']}:{$element['name']}" ] = $ element ; } $ elements += $ result ; } } return $ elements ; }
Complex types and groups may contain nested elements
The purpose of this function is to retrieve such nested elements
@param array|string $type The name of a type or an array representing a type
Complex types and groups may contain nested elements The purpose of this function is to retrieve such nested elements