public function import(RemotePackageEntity $remotePackage)
    {
        $temp = $this->download($remotePackage);
        $rootPath = $this->getRootPath($temp);
        $this->translatableImporter->importDirectory($rootPath, $remotePackage->getHandle(), $remotePackage->getVersion(), '');
        $package = $this->packageRepo->findOneBy(['handle' => $remotePackage->getHandle()]);
        if ($package !== null) {
            /* @var \CommunityTranslation\Entity\Package $package */
            $persist = false;
            if ($remotePackage->getName() !== '' && $remotePackage->getName() !== $package->getName()) {
                $package->setName($remotePackage->getName());
                $persist = true;
            }
            if ($remotePackage->getUrl() !== '' && $remotePackage->getUrl() !== $package->getUrl()) {
                $package->setUrl($remotePackage->getUrl());
                $persist = true;
            }
            if ($persist) {
                $this->em->persist($package);
                $this->em->flush($package);
            }
        }
    }
public function import(RemotePackageEntity $remotePackage)
    {
        $temp = $this->download($remotePackage);
        $rootPath = $this->getRootPath($temp);
        $this->translatableImporter->importDirectory($rootPath, $remotePackage->getHandle(), $remotePackage->getVersion(), '');
        $package = $this->packageRepo->findOneBy(['handle' => $remotePackage->getHandle()]);
        if ($package !== null) {
            /* @var \CommunityTranslation\Entity\Package $package */
            $persist = false;
            if ($remotePackage->getName() !== '' && $remotePackage->getName() !== $package->getName()) {
                $package->setName($remotePackage->getName());
                $persist = true;
            }
            if ($remotePackage->getUrl() !== '' && $remotePackage->getUrl() !== $package->getUrl()) {
                $package->setUrl($remotePackage->getUrl());
                $persist = true;
            }
            if ($persist) {
                $this->em->persist($package);
                $this->em->flush($package);
            }
        }
    }
public function import ( RemotePackageEntity $ remotePackage ) { $ temp = $ this -> download ( $ remotePackage ) ; $ rootPath = $ this -> getRootPath ( $ temp ) ; $ this -> translatableImporter -> importDirectory ( $ rootPath , $ remotePackage -> getHandle ( ) , $ remotePackage -> getVersion ( ) , '' ) ; $ package = $ this -> packageRepo -> findOneBy ( [ 'handle' => $ remotePackage -> getHandle ( ) ] ) ; if ( $ package !== null ) { /* @var \CommunityTranslation\Entity\Package $package */ $ persist = false ; if ( $ remotePackage -> getName ( ) !== '' && $ remotePackage -> getName ( ) !== $ package -> getName ( ) ) { $ package -> setName ( $ remotePackage -> getName ( ) ) ; $ persist = true ; } if ( $ remotePackage -> getUrl ( ) !== '' && $ remotePackage -> getUrl ( ) !== $ package -> getUrl ( ) ) { $ package -> setUrl ( $ remotePackage -> getUrl ( ) ) ; $ persist = true ; } if ( $ persist ) { $ this -> em -> persist ( $ package ) ; $ this -> em -> flush ( $ package ) ; } } }
Import a remote package.


@param RemotePackageEntity $remotePackage

@throws UserMessageException
Import a remote package .