示例#1
0
 /**
  * Generate Standalone Files
  *
  * @param string $bundle The bundle name
  * @param string $tag    A tag name to filter files
  */
 public function generateStandaloneFiles($bundle, $tag)
 {
     $avroGenerator = new Generator($this->container, $this->output);
     $avroGenerator->initializeBundleParameters($bundle->getName());
     $standaloneFiles = $this->container->getParameter('avro_generator.standalone_files');
     if (is_array($standaloneFiles)) {
         foreach ($standaloneFiles as $file) {
             if ($tag) {
                 if (in_array($tag, $file['tags'])) {
                     $avroGenerator->generate($file);
                 }
             } else {
                 $avroGenerator->generate($file);
             }
         }
     }
 }