2017 © Pedro Peláez
 

library doctrine-data-fixture-module

Zend Framework 3 Module that provides Doctrine Data-Fixture functionality

image

drakulitka/doctrine-data-fixture-module

Zend Framework 3 Module that provides Doctrine Data-Fixture functionality

  • Thursday, June 28, 2018
  • by drakulitka
  • Repository
  • 1 Watchers
  • 1 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

DoctrineDataFixture Module for Zend Framework 3

Introduction

This is fork from dkorsak/doctrine-data-fixture-module., (*1)

The DoctrineDataFixtureModule module intends to integrate Doctrine2 ORM Data Fixtures with Zend Framework 3., (*2)

Installation

Installation of this module uses composer. For composer documentation, please refer to getcomposer.org., (*3)

$ php composer.phar require drakulitka/doctrine-data-fixture-module

Then open config/application.config.php and add DoctrineModule, DoctrineORMModule and DoctrineDataFixtureModule to your modules, (*4)

Registering Fixtures

To register fixtures with Doctrine module add the fixtures in your configuration., (*5)

<?php
return [
    'doctrine' => [
        'fixture' => [
            'YourModuleName' => __DIR__ . '/../src/Fixture',
        ],
    ],
];

Usage

Default
./vendor/bin/doctrine-module orm:fixtures:load 
Purge with truncate and without confirmation
./vendor/bin/doctrine-module orm:fixtures:load -n --purge-with-truncate 
Append data instead of delete
./vendor/bin/doctrine-module orm:fixtures:load -n --append

How to inject container into fixtures file

<?php

namespace YourModuleName\Fixture;

use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use DoctrineDataFixtureModule\ContainerAwareInterface;
use DoctrineDataFixtureModule\ContainerAwareTrait;

class LoadUser implements FixtureInterface, ContainerAwareInterface
{
    use ContainerAwareTrait;

    /**
     * @param ObjectManager $manager
     */
    public function load(ObjectManager $manager)
    {
        $myService = $this->container->get('my_service');        
    }
}

The Versions

28/06 2018

dev-master

9999999-dev

Zend Framework 3 Module that provides Doctrine Data-Fixture functionality

  Sources   Download

MIT

The Requires

 

by Sergey Vakulenko

doctrine module zf3 data-fixture

28/06 2018

1.0.1

1.0.1.0

Zend Framework 3 Module that provides Doctrine Data-Fixture functionality

  Sources   Download

MIT

The Requires

 

by Sergey Vakulenko

doctrine module zf3 data-fixture

28/06 2018

1.0.2

1.0.2.0

Zend Framework 3 Module that provides Doctrine Data-Fixture functionality

  Sources   Download

MIT

The Requires

 

by Sergey Vakulenko

doctrine module zf3 data-fixture

28/06 2018

1.0.0

1.0.0.0

Zend Framework 3 Module that provides Doctrine Data-Fixture functionality

  Sources   Download

MIT

The Requires

 

by Sergey Vakulenko

doctrine module zf3 data-fixture