From 2b6beddb2a7792068e8bdfdcbe00010888ae5e1c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Thu, 31 Oct 2024 07:49:56 +0100 Subject: [PATCH] Add bundle fixture --- Fixture/TreeFixture.php | 45 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Fixture/TreeFixture.php diff --git a/Fixture/TreeFixture.php b/Fixture/TreeFixture.php new file mode 100644 index 0000000..8ea1b4b --- /dev/null +++ b/Fixture/TreeFixture.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Rapsys\TreeBundle\Fixture; + +use Doctrine\Bundle\FixturesBundle\Fixture; +use Doctrine\Persistence\ObjectManager; + +use Rapsys\TreeBundle\RapsysTreeBundle; + +use Symfony\Component\DependencyInjection\ContainerInterface; + +/** + * {@inheritdoc} + */ +class TreeFixture extends Fixture { + /** + * Config array + */ + protected array $config; + + /** + * Air fixtures constructor + */ + public function __construct(protected ContainerInterface $container) { + //Retrieve config + $this->config = $container->getParameter(RapsysTreeBundle::getAlias()); + } + + /** + * {@inheritDoc} + */ + public function load(ObjectManager $manager) { + //Flush to get the ids + $manager->flush(); + } +} -- 2.41.1