codeedu/zend-doctrine-fixture
最新稳定版本:0.1.0
Composer 安装命令:
composer require codeedu/zend-doctrine-fixture
包简介
Zend Library that provides Doctrine Data-Fixture functionality
关键字:
README 文档
README
This library provides integration with Zend Framework and Doctrine Data Fixture. Also support PSR-11. It's based in zendexpr-doctrine-fixture
Get started
Instalation
composer require codeedu/zend-doctrine-fixture:0.0.1
Registering Fixtures
To register fixtures add the fixtures in your configuration.
[
'doctrine' => [
'fixtures' => [
'MyFixtures' => __DIR__ . '/../src/Fixture',
]
]
];
Register the module in modules.config.php:
'CodeEdu\DoctrineFixture'
Usage
Command Line
Access the Doctrine command line as following
Import
./vendor/bin/doctrine-module data-fixture:import
Dependency Injection with Fixtures
This library provides inject the service container in fixtures. So add interface FixtureContainerInterface, see below:
class MyFixture implements FixtureInterface, FixtureContainerInterface { private $container; public function load(ObjectManager $manager){ $myService = $this->container->get(MyService::class); } public function getContainer() { return $this->container; } public function setContainer(ContainerInterface $container) { $this->container = $container; } }
统计信息
- 总下载量: 2.97k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-09-24