private function updateEntitiesSchema(BundleInterface $bundle, $force = false)
    {
        if (!is_dir($entityDir = $this->getBundleEntityDir($bundle))) {
            return [];
        }

        $bundleEntityManager = $bundle->getEntityManager();
        $bundleEntityManager
            ->getConfiguration()
            ->getMetadataDriverImpl()
            ->addPaths([
                $entityDir,
            ])
        ;

        $metadata = $bundleEntityManager->getMetadataFactory()->getAllMetadata();
        $schemaTool = new SchemaTool($bundleEntityManager);
        $sqls = $schemaTool->getUpdateSchemaSql($metadata, true);
        if (true === $force) {
            $schemaTool->updateSchema($metadata, true);
        }

        return $sqls;
    }
private function updateEntitiesSchema(BundleInterface $bundle, $force = false)
    {
        if (!is_dir($entityDir = $this->getBundleEntityDir($bundle))) {
            return [];
        }

        $bundleEntityManager = $bundle->getEntityManager();
        $bundleEntityManager
            ->getConfiguration()
            ->getMetadataDriverImpl()
            ->addPaths([
                $entityDir,
            ])
        ;

        $metadata = $bundleEntityManager->getMetadataFactory()->getAllMetadata();
        $schemaTool = new SchemaTool($bundleEntityManager);
        $sqls = $schemaTool->getUpdateSchemaSql($metadata, true);
        if (true === $force) {
            $schemaTool->updateSchema($metadata, true);
        }

        return $sqls;
    }
private function updateEntitiesSchema ( BundleInterface $ bundle , $ force = false ) { if ( ! is_dir ( $ entityDir = $ this -> getBundleEntityDir ( $ bundle ) ) ) { return [ ] ; } $ bundleEntityManager = $ bundle -> getEntityManager ( ) ; $ bundleEntityManager -> getConfiguration ( ) -> getMetadataDriverImpl ( ) -> addPaths ( [ $ entityDir , ] ) ; $ metadata = $ bundleEntityManager -> getMetadataFactory ( ) -> getAllMetadata ( ) ; $ schemaTool = new SchemaTool ( $ bundleEntityManager ) ; $ sqls = $ schemaTool -> getUpdateSchemaSql ( $ metadata , true ) ; if ( true === $ force ) { $ schemaTool -> updateSchema ( $ metadata , true ) ; } return $ sqls ; }
Creates SQL requests to update your bundle entities and executes them against application database
if force is equal to true.

@param  BundleInterface $bundle
@param  boolean         $force
@return array
Creates SQL requests to update your bundle entities and executes them against application database if force is equal to true .