2017 © Pedro Peláez
 

zf2-module doctrine-fixtures-module

Zend Framework 2 integration with the Doctrine Fixtures library

image

kupishkis/doctrine-fixtures-module

Zend Framework 2 integration with the Doctrine Fixtures library

  • Thursday, January 25, 2018
  • by houngan
  • Repository
  • 4 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 12 Versions
  • 0 % Grown

The README.md

KupDoctrineFixtures module (fork of EwgoDoctrineFixtures module)

About

The KupDoctrineFixtures module provides ZF2 integration with the Doctrine Fixtures library. Difference from EwgoDoctrineFixtures is that this module actually supports fixtures loading from single file., (*1)

Installation

``` bash $ php composer.phar require kupishkis/doctrine-fixtures-module, (*2)


Add "KupDoctrineFixtures" to the list of loaded modules. ## Configuration Add the paths to the fixtures in your modules configuration ``` php array( 'doctrinefixtures' => array( 'paths' => array( 'MyModule' => __DIR__ . '/../src/MyModule/DataFixtures/ORM' ) ) )

Usage

Create your fixture classes.
You can implement Zend\ServiceManager\ServiceLocatorAwareInterface in order to use the ServiceManager in your fixture class.
You can also directly extend EwgoDoctrineFixtures\Fixture\ServiceLocatorAwareAbstractFixture in order to get the benefits of both ServiceLocatorAwareInterface and AbstractFixture., (*3)

``` php namespace MyModule\DataFixtures\ORM;, (*4)

use KupDoctrineFixtures\Fixture\ServiceLocatorAwareAbstractFixture; use Doctrine\Common\Persistence\ObjectManager; use MyModule\Entity\User;, (*5)

class LoadUserData extends ServiceLocatorAwareAbstractFixture { public function load(ObjectManager $manager) { // Encode the password any way you want $password = $this->serviceLocator->get('MySuperEncoder')->encode('myAwesomePassword');, (*6)

    $user = new User();
    $user->setUsername('test');
    $user->setPassword($password);
    $user->setPassword('test@test.com');

    $manager->persist($user);
    $manager->flush();
}

}, (*7)


``` bash $ vendor/bin/doctrine-module fixtures:load

See the help (--help) for options., (*8)

For more information see the Doctrine Fixtures documentation., (*9)

The Versions

25/01 2018

dev-master

9999999-dev

Zend Framework 2 integration with the Doctrine Fixtures library

  Sources   Download

The Requires

 

zf2 doctrine fixtures

25/01 2018

1.1.3

1.1.3.0

Zend Framework 2 integration with the Doctrine Fixtures library

  Sources   Download

The Requires

 

zf2 doctrine fixtures

25/01 2018

1.1.2

1.1.2.0

Zend Framework 2 integration with the Doctrine Fixtures library

  Sources   Download

The Requires

 

zf2 doctrine fixtures

25/01 2018

1.1.1

1.1.1.0

Zend Framework 2 integration with the Doctrine Fixtures library

  Sources   Download

The Requires

 

zf2 doctrine fixtures

25/01 2018

1.1.0

1.1.0.0

Zend Framework 2 integration with the Doctrine Fixtures library

  Sources   Download

The Requires

 

zf2 doctrine fixtures

03/11 2017

1.0.6

1.0.6.0

Zend Framework 2 integration with the Doctrine Fixtures library

  Sources   Download

The Requires

 

zf2 doctrine fixtures

02/11 2017

1.0.5

1.0.5.0

Zend Framework 2 integration with the Doctrine Fixtures library

  Sources   Download

The Requires

 

zf2 doctrine fixtures

02/11 2017

1.0.4

1.0.4.0

Zend Framework 2 integration with the Doctrine Fixtures library

  Sources   Download

The Requires

 

zf2 doctrine fixtures

02/11 2017

1.0.3

1.0.3.0

Zend Framework 2 integration with the Doctrine Fixtures library

  Sources   Download

The Requires

 

zf2 doctrine fixtures

31/10 2017

1.0.2

1.0.2.0

Zend Framework 2 integration with the Doctrine Fixtures library

  Sources   Download

The Requires

 

zf2 doctrine fixtures

31/10 2017

1.0.1

1.0.1.0

Zend Framework 2 integration with the Doctrine Fixtures library

  Sources   Download

The Requires

 

zf2 doctrine fixtures

31/10 2017

1.0.0

1.0.0.0

Zend Framework 2 integration with the Doctrine Fixtures library

  Sources   Download

The Requires

 

zf2 doctrine fixtures