Download the PHP package kunstmaan/fixtures-bundle without Composer
On this page you can find all versions of the php package kunstmaan/fixtures-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kunstmaan/fixtures-bundle
More information about kunstmaan/fixtures-bundle
Files in kunstmaan/fixtures-bundle
Package fixtures-bundle
Short Description With this bundle you'll be able to create fixtures through yaml files in an easy way
License MIT
Homepage https://github.com/Kunstmaan/FixturesBundle
Informations about the package fixtures-bundle
How to use the FixturesBundle
You will still use the default doctrine fixtures way but instead of extending from the Doctrine\Common\DataFixtures\AbstractFixture
class,
you will instead extend from the Kunstmaan\FixturesBundle\Loader\FixtureLoader
class.
This is what your fixture class will look like:
Yaml you say?
Yes! Creating fixtures will has never been this easy. It's inspired by the Nelmio/Alice bundle. Why don't we use that bundle? That's because Nelmio/Alice is great for "simple" entities, but with our CMS alot of stuff happens during the creation of pages and pageparts. For this reason we wanted to start from scratch instead of hacking our way into another bundle.
So how do these yaml files look like?
Providers
Providers are classes that can be used to return data to a fixture. For example, if you use the method, the Spec provider will be called upon. So if you want to add some functionality to easily return the value of the page creator, you can add a Provider that contains the method
By default you can add these kind of methods to your fixture class as it's automatically added as a provider.
Furthermore you have the Spec provider, NodeTranslation provider and Faker providers. You can add your own by adding the function to your fixture class and returning an array containing your providers or you can tag your providers with .
Parsers
Parsers are used to translate the yaml data into actual data. So something like will be transformed to an object by different parsers. By default you have the Method and the Reference parser for property data and the Listed and Range parser for specs. If you want to add your own parser, you can simply to that by tagging them with or
Populators
Does exactly what the name says. Populators will populate the entities once all the yaml data is parsed. If you want to add your own populator, simply tag it with
Builders
With builders you can manipulate the behaviour during the creation of your entity. This can happen in three stages, preBuild, postBuild and postFlushBuild. During these stages you can manipulate your entity or add more entities like we do in the PageBuilder for instance. If you want to add your own builder, simply tag it with
All versions of fixtures-bundle with dependencies
doctrine/doctrine-fixtures-bundle Version ^3.3
fakerphp/faker Version ^1.15
kunstmaan/admin-bundle Version ^7.0
kunstmaan/media-bundle Version ^7.0
kunstmaan/menu-bundle Version ^7.0
kunstmaan/node-bundle Version ^7.0
kunstmaan/pagepart-bundle Version ^7.0
kunstmaan/utilities-bundle Version ^7.0
symfony/string Version ^5.4|^6.4
symfony/mime Version ^5.4|^6.4