nelmio-alice

Alice fixtures - Persist and reference a first set of entities/objects

空扰寡人 提交于 2019-12-11 06:02:59
问题 Alice has given away the persistence layer in 3.x. In the attempt of migrating from 2.2 to 3.0.x, … I need to load and persist some fixtures first (so their id get populated) and then reference those entities ids from another bunch of fixture files. How can this be achieved ? I guess I may have to loop and load multiple fixture files sets separately but I have no idea how objects references will subsist in such scenario. My setup currently doesn't work but causes the following error to prompt

How to create custom function/formatter nelmio/alice v.3?

余生长醉 提交于 2019-12-08 02:37:48
问题 I'm new to symfony 4 and tried to write my own function for yml nelmio/alice, but after I ran bin/console doctrine:fixtures:load , I got this error: In DeepCopy.php line 177: The class "ReflectionClass" is not cloneable. Here is my fixtures.yml file: App\Entity\Post: post_{1..10}: title: <customFunction()> Here is my AppFixture.php file: <?php namespace App\DataFixtures; use Doctrine\Bundle\FixturesBundle\Fixture; use Doctrine\Common\Persistence\ObjectManager; use Nelmio\Alice\Loader

How to create custom function/formatter nelmio/alice v.3?

删除回忆录丶 提交于 2019-12-06 06:23:28
I'm new to symfony 4 and tried to write my own function for yml nelmio/alice, but after I ran bin/console doctrine:fixtures:load , I got this error: In DeepCopy.php line 177: The class "ReflectionClass" is not cloneable. Here is my fixtures.yml file: App\Entity\Post: post_{1..10}: title: <customFunction()> Here is my AppFixture.php file: <?php namespace App\DataFixtures; use Doctrine\Bundle\FixturesBundle\Fixture; use Doctrine\Common\Persistence\ObjectManager; use Nelmio\Alice\Loader\NativeLoader; class AppFixtures extends Fixture { public function load(ObjectManager $manager) { $loader = new