基本からしっかり学ぶSymfony2入門をやっていて、
9章のフィクスチャの読み込み(p271)で以下のようなエラーが出てしまったので調べたメモ。
$ php app/console doctrine:fixtures:load Careful, database will be purged. Do you want to continue y/N ?y > purging database [Symfony\Component\Debug\Exception\FatalThrowableError] Fatal error: Call to undefined method Doctrine\ORM\Internal\CommitOrderCalculator::addClass() doctrine:fixtures:load [--fixtures [FIXTURES]] [--append] [--em EM] [--shard SHARD] [--purge-with-truncate] [--multiple-transactions]
すると以下のページが見つかった。
This should resolve changes made in the latest release of doctrine2 #212
lib/Doctrine/ORM/Internal/CommitOrderCalculator.php
が変わってしまっていてエラーが出るように・・・。
ここの修正をとりあえずあててみた。
https://github.com/macnibblet/data-fixtures/commit/e92a836acda145867d4fd5138d27e6d991e74954
lib/Doctrine/Common/DataFixtures/Purger/ORMPurger.php
$ php app/console doctrine:fixtures:load Careful, database will be purged. Do you want to continue y/N ?y > purging database > loading AppBundle\DataFixtures\ORM\LoadInquiryData > loading AppBundle\DataFixtures\ORM\LoadConcertData > loading AppBundle\DataFixtures\ORM\BlogArticleLoader
一応動いた。
こっちも試してみた。
DoctrineFixturesBundle/composer.json
$ composer remove doctrine/doctrine-fixtures-bundle $ composer require doctrine/data-fixtures '~1.0' $ php app/console doctrine:fixtures:load Careful, database will be purged. Do you want to continue y/N ?y > purging database > loading AppBundle\DataFixtures\ORM\LoadInquiryData > loading AppBundle\DataFixtures\ORM\LoadConcertData > loading AppBundle\DataFixtures\ORM\BlogArticleLoader