code/transform/ExternalContentImporter.php
public function import($contentItem, $target, $includeParent = false, $includeChildren = true, $duplicateStrategy='Overwrite', $params = array()) {
		$this->runOnImportStart();
		$this->params = $params;

		// if the queuedjobs module exists, use that
		$queuedVersion = 'Queued' . get_class($this);
		if ($this->config()->use_queue && ClassInfo::exists('QueuedJob') && ClassInfo::exists($queuedVersion)) {
			$importer = new $queuedVersion(
							$contentItem,
							$target,
							$includeParent,
							$includeChildren,
							$duplicateStrategy,
							$params);

			$service = singleton('QueuedJobService');
			$service->queueJob($importer);
			return $importer;
		}

		$children = null;
		if ($includeParent) {
			// Get the children of a particular node
			$children = new ArrayList();
			$children->push($contentItem);
		} else {
			$children = $contentItem->stageChildren();
		}

		$this->importChildren($children, $target, $includeChildren, $duplicateStrategy);
		$this->runOnImportEnd();
		return true;
	}
public function import($contentItem, $target, $includeParent = false, $includeChildren = true, $duplicateStrategy='Overwrite', $params = array()) {
		$this->runOnImportStart();
		$this->params = $params;

		// if the queuedjobs module exists, use that
		$queuedVersion = 'Queued' . get_class($this);
		if ($this->config()->use_queue && ClassInfo::exists('QueuedJob') && ClassInfo::exists($queuedVersion)) {
			$importer = new $queuedVersion(
							$contentItem,
							$target,
							$includeParent,
							$includeChildren,
							$duplicateStrategy,
							$params);

			$service = singleton('QueuedJobService');
			$service->queueJob($importer);
			return $importer;
		}

		$children = null;
		if ($includeParent) {
			// Get the children of a particular node
			$children = new ArrayList();
			$children->push($contentItem);
		} else {
			$children = $contentItem->stageChildren();
		}

		$this->importChildren($children, $target, $includeChildren, $duplicateStrategy);
		$this->runOnImportEnd();
		return true;
	}
public function import ( $ contentItem , $ target , $ includeParent = false , $ includeChildren = true , $ duplicateStrategy = 'Overwrite' , $ params = array ( ) ) { $ this -> runOnImportStart ( ) ; $ this -> params = $ params ; // if the queuedjobs module exists, use that $ queuedVersion = 'Queued' . get_class ( $ this ) ; if ( $ this -> config ( ) -> use_queue && ClassInfo :: exists ( 'QueuedJob' ) && ClassInfo :: exists ( $ queuedVersion ) ) { $ importer = new $ queuedVersion ( $ contentItem , $ target , $ includeParent , $ includeChildren , $ duplicateStrategy , $ params ) ; $ service = singleton ( 'QueuedJobService' ) ; $ service -> queueJob ( $ importer ) ; return $ importer ; } $ children = null ; if ( $ includeParent ) { // Get the children of a particular node $ children = new ArrayList ( ) ; $ children -> push ( $ contentItem ) ; } else { $ children = $ contentItem -> stageChildren ( ) ; } $ this -> importChildren ( $ children , $ target , $ includeChildren , $ duplicateStrategy ) ; $ this -> runOnImportEnd ( ) ; return true ; }
Import from a content source to a particular target

@param ExternalContentItem $contentItem
@param SiteTree $target
@param boolean $includeParent
Whether to include the selected item in the import or not
@param String $duplicateStrategy
How to handle duplication
@param array $params All parameters passed with the import request.
Import from a content source to a particular target