2017-07-13 1 views
0

私はDoctrineのエンティティを作成しようとしています:InvalidArgumentException Synfomy2

php app/console doctrine:generate:entity --entity="AWStudio:Category" --fields="name:string(255)" --no-interaction 

しかし、私は、この戻りはできません。

[InvalidArgumentException]バンドル "AWStudio" は存在しないか、それはありません有効になっていません。あなたのAppKernel.phpファイルのregisterBundles()メソッドに追加するのを忘れたのでしょうか?

私APPKernel.php

<?php 

use Symfony\Component\HttpKernel\Kernel; 
use Symfony\Component\Config\Loader\LoaderInterface; 

class AppKernel extends Kernel 
{ 
    public function __construct($environment, $debug) 
    { 
     date_default_timezone_set('Europe/Paris'); 
     parent::__construct($environment, $debug); 
    } 

    public function registerBundles() 
    { 
     $bundles = array(
      new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), 
      new Symfony\Bundle\SecurityBundle\SecurityBundle(), 
      new Symfony\Bundle\TwigBundle\TwigBundle(), 
      new Symfony\Bundle\MonologBundle\MonologBundle(), 
      new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(), 
      new Symfony\Bundle\AsseticBundle\AsseticBundle(), 
      new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), 
      new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), 
      new AWStudio\AWCoreBundle\AWCoreBundle(), 
      new \FOS\UserBundle\FOSUserBundle(), 
      new \AWStudio\AWUserBundle\AWUserBundle(), 
      new AWStudio\CKSBundle\AWStudioCKSBundle(), 
      new JMS\AopBundle\JMSAopBundle(), 
      new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(), 
      new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(), 
      new FOS\JsRoutingBundle\FOSJsRoutingBundle, 
      new JMS\SerializerBundle\JMSSerializerBundle(), 
      new Liuggio\ExcelBundle\LiuggioExcelBundle(), 
      new JMS\TwigJsBundle\JMSTwigJsBundle(), 
      new RaulFraile\Bundle\LadybugBundle\RaulFraileLadybugBundle(), 
      new JMS\DiExtraBundle\JMSDiExtraBundle($this), 
      new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(), 
      new \Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(), 
      new \Fresh\Bundle\DoctrineEnumBundle\FreshDoctrineEnumBundle(), 
      new Corley\MaintenanceBundle\CorleyMaintenanceBundle(), 
      new Sonata\CoreBundle\SonataCoreBundle(), 
      new Sonata\BlockBundle\SonataBlockBundle(), 
      new Knp\Bundle\MenuBundle\KnpMenuBundle(), 
      new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(), 
      new Sonata\AdminBundle\SonataAdminBundle() 
     ); 

     if (in_array($this->getEnvironment(), array('dev', 'test'))) { 
      $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); 
      $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); 
      $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); 
     } 

     return $bundles; 
    } 

    public function registerContainerConfiguration(LoaderInterface $loader) 
    { 
     $loader->load(__DIR__ . '/config/config_' . $this->getEnvironment() . '.yml'); 
    } 
} 

おかげであります! :)

+0

ベンダーのフォルダを確認し、バンドルがあることを確認しますか? –

+0

私のベンダーのフォルダに私は持っている:awstudio、awstudioでコマンドAWStudioを変更しようとしているが、これは同じエラーを返す:/ –

答えて

0

コマンドにバンドルの完全な名前を付ける必要があります。実際にはベンダー名はAWStudioです。

AWStudioベンダーには、AWCoreBundle,AWUserBundleおよびCKSBundleという3つのバンドルがあります。

php app/console doctrine:generate:entity --entity="AWStudioAWUserBundle:Category" --fields="name:string(255)" --no-interaction 

AWUserBundleバンドル名の後にAWStudio

あなたはAWCoreBundleにエンティティを追加したいとしましょう

は、ここにコマンドです。

+0

ありがとう、それはありがとう! –

関連する問題