code/transform/ExternalContentImporter.php
protected function importChildren($children, $parent, $includeChildren, $duplicateStrategy) {
		if (!$children) {
			return;
		}

		// get the importer to use, import, then see if there's any
		foreach ($children as $child) {
			$pageType = $this->getExternalType($child);
			if (isset($this->contentTransforms[$pageType])) {
				$transformer = $this->contentTransforms[$pageType];
				$result = $transformer->transform($child, $parent, $duplicateStrategy);

				$this->extend('onAfterImport', $result);

				// if there's more, then transform them
				if ($includeChildren && $result && $result->children && count($result->children)) {
					// import the children
					$this->importChildren($result->children, $result->page, $includeChildren, $duplicateStrategy);
				}
			}
		}
	}
protected function importChildren($children, $parent, $includeChildren, $duplicateStrategy) {
		if (!$children) {
			return;
		}

		// get the importer to use, import, then see if there's any
		foreach ($children as $child) {
			$pageType = $this->getExternalType($child);
			if (isset($this->contentTransforms[$pageType])) {
				$transformer = $this->contentTransforms[$pageType];
				$result = $transformer->transform($child, $parent, $duplicateStrategy);

				$this->extend('onAfterImport', $result);

				// if there's more, then transform them
				if ($includeChildren && $result && $result->children && count($result->children)) {
					// import the children
					$this->importChildren($result->children, $result->page, $includeChildren, $duplicateStrategy);
				}
			}
		}
	}
protected function importChildren ( $ children , $ parent , $ includeChildren , $ duplicateStrategy ) { if ( ! $ children ) { return ; } // get the importer to use, import, then see if there's any foreach ( $ children as $ child ) { $ pageType = $ this -> getExternalType ( $ child ) ; if ( isset ( $ this -> contentTransforms [ $ pageType ] ) ) { $ transformer = $ this -> contentTransforms [ $ pageType ] ; $ result = $ transformer -> transform ( $ child , $ parent , $ duplicateStrategy ) ; $ this -> extend ( 'onAfterImport' , $ result ) ; // if there's more, then transform them if ( $ includeChildren && $ result && $ result -> children && count ( $ result -> children ) ) { // import the children $ this -> importChildren ( $ result -> children , $ result -> page , $ includeChildren , $ duplicateStrategy ) ; } } } }
Execute the importing of several children

@param DataObjectSet $children
@param SiteTree $parent
Execute the importing of several children