concrete/src/Package/PackageService.php
public function bootPackageEntityManager(Package $p, $clearCache = false)
    {
        $configUpdater = new EntityManagerConfigUpdater($this->entityManager);
        $providerFactory = new PackageProviderFactory($this->application, $p);
        $provider = $providerFactory->getEntityManagerProvider();
        $configUpdater->addProvider($provider);
        if ($clearCache) {
            $cache = $this->entityManager->getConfiguration()->getMetadataCacheImpl();
            if ($cache) {
                $cache->flushAll();
            }
        }
    }
public function bootPackageEntityManager(Package $p, $clearCache = false)
    {
        $configUpdater = new EntityManagerConfigUpdater($this->entityManager);
        $providerFactory = new PackageProviderFactory($this->application, $p);
        $provider = $providerFactory->getEntityManagerProvider();
        $configUpdater->addProvider($provider);
        if ($clearCache) {
            $cache = $this->entityManager->getConfiguration()->getMetadataCacheImpl();
            if ($cache) {
                $cache->flushAll();
            }
        }
    }
public function bootPackageEntityManager ( Package $ p , $ clearCache = false ) { $ configUpdater = new EntityManagerConfigUpdater ( $ this -> entityManager ) ; $ providerFactory = new PackageProviderFactory ( $ this -> application , $ p ) ; $ provider = $ providerFactory -> getEntityManagerProvider ( ) ; $ configUpdater -> addProvider ( $ provider ) ; if ( $ clearCache ) { $ cache = $ this -> entityManager -> getConfiguration ( ) -> getMetadataCacheImpl ( ) ; if ( $ cache ) { $ cache -> flushAll ( ) ; } } }
Initialize the entity manager for a package.

@param \Concrete\Core\Package\Package $p The controller of package
@param bool $clearCache Should the entity metadata cache be emptied?
Initialize the entity manager for a package .