stargazer-team/yii-doctrine-fixture

Yii3 integration Doctrine fixture extension

1.0.2 2024-08-10 16:03 UTC

This package is not auto-updated.

Last update: 2024-11-16 17:10:37 UTC


README

Yii3 Doctrine Fixture Extension


Latest Stable Version Total Downloads Build status Code Coverage Scrutinizer Quality Score static analysis type-coverage

Installation

The preferred way to install this extension is through composer:

composer require stargazer-team/yii-doctrine-fixture --dev

Config

<?php

declare(strict_types=1);

use Yiisoft\Yii\DoctrineFixture\Enum\ConfigOptions;

'yiisoft/yii-doctrine-fixture' => [
        ConfigOptions::ENTITY_MANAGERS => [
            'default' => [
                ConfigOptions::DIRS => [
                    '@src/Fixture',
                ],
                ConfigOptions::FILES => [
                    '@src/Fixture/UserFixture.php',
                ],
                ConfigOptions::CLASSES => [
                    UserFixture::class,
                ],
            ],
        ],
    ]

Command:

  • doctrine:fixture:load

Load fixture:

php yii doctrine:fixture:load --em=default