Skip to content

Commit

Permalink
The file are generated with a command and not any more with the clear…
Browse files Browse the repository at this point in the history
…-cache
  • Loading branch information
Thomas Beaujean committed Apr 4, 2017
1 parent f734b17 commit 7ac2c1c
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 74 deletions.
49 changes: 0 additions & 49 deletions CacheWarmer/RepositoryGeneratorWarmer.php

This file was deleted.

37 changes: 37 additions & 0 deletions Command/GenerateCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

namespace tbn\QueryBuilderRepositoryGeneratorBundle\Command;

use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use tbn\QueryBuilderRepositoryGeneratorBundle\Generator\RepositoryGenerator;

/**
*
*/
class GenerateCommand extends ContainerAwareCommand
{
/**
*
*/
protected function configure()
{
$this->setName('qbrg:generate');
$this->setDescription('Regenerate the Base Repository with the Query Builder Repository Generator');
}

/**
*
* @param InputInterface $input
* @param OutputInterface $output
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
/* @var $generator RepositoryGenerator */
$generator = $this->getContainer()->get('tbn_qbrg.generator.repository_generator');
$generator->generateFiles();

$output->writeln('<info>The repositories have been regenerated</info>');
}
}
19 changes: 0 additions & 19 deletions QueryBuilderRepositoryGeneratorBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace tbn\QueryBuilderRepositoryGeneratorBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;

/**
*
Expand All @@ -12,22 +11,4 @@
*/
class QueryBuilderRepositoryGeneratorBundle extends Bundle
{
/**
* (non-PHPdoc)
* @see \Symfony\Component\HttpKernel\Bundle\Bundle::boot()
*/
public function boot()
{
}

/**
* (non-PHPdoc)
* @see \Symfony\Component\HttpKernel\Bundle\Bundle::build()
*
* @param ContainerBuilder $container
*/
public function build(ContainerBuilder $container)
{
parent::build($container);
}
}
6 changes: 0 additions & 6 deletions Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,3 @@ services:
arguments:
- "%tbn_qbrg.generator.template.entity_configuration%"
- "%tbn_qbrg.generator.template.repository_extension%"
tbn_qbrg.generator.repository_generator_warmer:
class: tbn\QueryBuilderRepositoryGeneratorBundle\CacheWarmer\RepositoryGeneratorWarmer
arguments:
- "@tbn_qbrg.generator.repository_generator"
tags:
- {name: "kernel.cache_warmer"}

0 comments on commit 7ac2c1c

Please sign in to comment.