第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

更新 Doctrine 后 Symfony 中的“ObjectManager

更新 Doctrine 后 Symfony 中的“ObjectManager

PHP
慕森卡 2022-06-11 18:03:53
在我的 Symfony 項目中嘗試更新( composer update )后出現(xiàn)錯誤。我尋找了一個解決方案,我發(fā)現(xiàn)有必要修改實體和構(gòu)造函數(shù)中的使用和類型提示......我已經(jīng)完成了!然后,我重新啟動了更新,但出現(xiàn)了不同的錯誤,并且更新沒有完全完成。結(jié)果:我的網(wǎng)站已關(guān)閉并顯示兼容性錯誤??催@個:編譯錯誤:AppFixtures 中 App\DataFixtures\AppFixtures::load(Doctrine\ORM\EntityManagerInterface $manager) 的聲明必須與 Doctrine\Common\DataFixtures\FixtureInterface::load(Doctrine\Common\Persistence\ObjectManager $manager) 兼容。 php第8行`不明白,兼容是什么?我不知道如何發(fā)布我的代碼..(控制器,YAML,實體,..)但我嘗試了。我的項目在出現(xiàn)錯誤之前在 GitHub 上,也許它會很有用(如果你需要的話..)這是我的 AppFixtures.php :<?phpnamespace App\DataFixtures;use Doctrine\Bundle\FixturesBundle\Fixture;use Doctrine\ORM\EntityManagerInterface;class AppFixtures extends Fixture{    public function load(EntityManagerInterface $manager)    {        // $product = new Product();        // $manager->persist($product);        $manager->flush();    }}
查看完整描述

2 回答

?
白衣染霜花

TA貢獻1796條經(jīng)驗 獲得超10個贊

我想現(xiàn)在用 symfony 4.3 糾正 lhor kostrov,你需要使用 ObjectManager fromDoctrine\Persistence\ObjectManager 而不是 fromDoctrine\Common\Persistence\ObjectManager

查看完整回答
反對 回復 2022-06-11
?
HUH函數(shù)

TA貢獻1836條經(jīng)驗 獲得超4個贊

在您的基類Fixture$manager 實例中Doctrine\Common\Persistence\ObjectManager,因此您需要更改EntityManagerInterfaceObjectManager. 您不能在子類中覆蓋 typehint。



查看完整回答
反對 回復 2022-06-11
  • 2 回答
  • 0 關(guān)注
  • 136 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號