private function ensureInitialized()
 {
     if (!CommandExecutor::isCurrentCommand('oro:entity-extend:cache:', true)) {
         ExtendClassLoadingUtils::ensureDirExists(ExtendClassLoadingUtils::getEntityCacheDir($this->cacheDir));
         if (!file_exists(ExtendClassLoadingUtils::getAliasesPath($this->cacheDir))) {
             $this->initializeCache();
         }
         $this->ensureAliasesSet();
     }
 }
Esempio n. 2
0
 /**
  * Generates extended entities
  *
  * @param array $schemas
  */
 public function generate(array $schemas)
 {
     ExtendClassLoadingUtils::ensureDirExists($this->entityCacheDir);
     $aliases = [];
     foreach ($schemas as $schema) {
         $this->generateSchemaFiles($schema);
         if ($schema['type'] === 'Extend') {
             $aliases[$schema['entity']] = $schema['parent'];
         }
     }
     // write PHP class aliases to the file
     file_put_contents(ExtendClassLoadingUtils::getAliasesPath($this->cacheDir), serialize($aliases));
 }