public function copyLocalization(
			Localization $source,
			LocaleInterface $targetLocale
	) {
		$deepCopy = new DeepCopy();

		$entityManager = $this->container->getDoctrine()->getManagerForClass(get_class($source));

		// Matches Localization::$master.
		// Prevents AbstractPage to be cloned.
		$deepCopy->addFilter(new KeepFilter(), new PropertyMatcher(get_class($source), 'master'));

		$this->addDeepCopyCommonFilters($deepCopy, $entityManager);

		$copiedLocalization = $deepCopy->copy($source);

		$copiedLocalization->setLocaleId($targetLocale->getId());

		$entityManager->persist($copiedLocalization);

		return $copiedLocalization;
	}
public function copyLocalization(
			Localization $source,
			LocaleInterface $targetLocale
	) {
		$deepCopy = new DeepCopy();

		$entityManager = $this->container->getDoctrine()->getManagerForClass(get_class($source));

		// Matches Localization::$master.
		// Prevents AbstractPage to be cloned.
		$deepCopy->addFilter(new KeepFilter(), new PropertyMatcher(get_class($source), 'master'));

		$this->addDeepCopyCommonFilters($deepCopy, $entityManager);

		$copiedLocalization = $deepCopy->copy($source);

		$copiedLocalization->setLocaleId($targetLocale->getId());

		$entityManager->persist($copiedLocalization);

		return $copiedLocalization;
	}
public function copyLocalization ( Localization $ source , LocaleInterface $ targetLocale ) { $ deepCopy = new DeepCopy ( ) ; $ entityManager = $ this -> container -> getDoctrine ( ) -> getManagerForClass ( get_class ( $ source ) ) ; // Matches Localization::$master. // Prevents AbstractPage to be cloned. $ deepCopy -> addFilter ( new KeepFilter ( ) , new PropertyMatcher ( get_class ( $ source ) , 'master' ) ) ; $ this -> addDeepCopyCommonFilters ( $ deepCopy , $ entityManager ) ; $ copiedLocalization = $ deepCopy -> copy ( $ source ) ; $ copiedLocalization -> setLocaleId ( $ targetLocale -> getId ( ) ) ; $ entityManager -> persist ( $ copiedLocalization ) ; return $ copiedLocalization ; }
Makes deep copy with persisting.

@param Localization $source
@param LocaleInterface $targetLocale
@return Localization
Makes deep copy with persisting .