jupeter/doctrine-dump-fixtures-bundle
最新稳定版本:1.1
Composer 安装命令:
composer require jupeter/doctrine-dump-fixtures-bundle
包简介
Symfony DoctrineDumpFixturesBundle
关键字:
README 文档
README
Bundle for Symfony 3, with you can dump database data into fixtures.
Dump Fixtures are used to dump database data into fixtures file.
Setup and Configuration
Doctrine Dump fixtures for Symfony are maintained in the DoctrineDumpFixturesBundle.
The bundle uses external Doctrine Data Fixtures library.
Follow these steps to install the bundle and the library in the Symfony Standard edition. Run command in your project diretory:
$ composer require jupeter/doctrine-dump-fixtures-bundle
Finally, register the Bundle DoctrineDumpFixturesBundle in app/AppKernel.php.
// ... public function registerBundles() { $bundles = array( // ... new TeamLab\Bundle\FixturesBundle\DoctrineDumpFixturesBundle(), // ... ); // ... }
Configuration
To dump entity data, you need setup annotation for entity:
namespace AppBundle\Entity; use Doctrine\ORM\Mapping as ORM; use TeamLab\Bundle\FixturesBundle\Mapping as Dump; # use Annotation /** * @ORM\Entity * @Dump\Entity # configure with entities should be dumped */ class Offers { // ... /** * @ORM\Column(type="string") * @Dump\Column # configure with columns should be dumped */ private function $name; // ... }
Dump existing data into fixtures
To dump all data from database to Fixtures, run command:
$ ./bin/console doctrine:fixtures:dump
统计信息
- 总下载量: 3.56k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2013-07-09