Giter VIP home page Giter VIP logo

doctrinedatafixturemodule's People

Contributors

ackimwilliams avatar adamlundrigan avatar argentinaluiz avatar caferrari avatar hounddog avatar maxnuf avatar ocramius avatar thomaroger avatar tomhanderson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

doctrinedatafixturemodule's Issues

DoctrineORMModule is now 1.0.0 but DoctrineDataFixtureModule composer requires ~0.7

Hi,

the new DoctrineORMModule is released since some time now to version 1.0.0 (https://github.com/doctrine/DoctrineORMModule/releases/tag/1.0.0).

I will really like to use your module with the DoctrineORMModule 1.0.0 but the composer Required ~0.7 is set a little bit low:

  • hounddog/doctrine-data-fixture-module 0.0.4 requires doctrine/doctrine-orm-module ~0.7 -> satisfiable by doctrine/doctrine-orm-module[0.10.0, 0.11.0, 0.7.0, 0.8.0, 0.8.0-beta1, 0.8.0-beta2, 0.8.0-beta3, 0.8.0-beta4, 0.9.0, 0.9.1, 0.9.2] but these conflict with your requirements or minimum-stability.

THX!

Allow fixtures to implement ServiceLocatorAwareInterface

Idea is stolen from Symfony 2. You can make fixtures implement the Zend\ServiceManager\ServiceLocatorAwareInterface and then you get the service manager injected. It might come in handy if some fixtures needs to be "processed" where the logic is already defined in one of your services.

Wrong Registering Fixtures configuration

Hello,

The configuration for Registering Fixtures

return array(
      'data-fixture' => array(
            'ModuleName_fixture' => __DIR__ . '/../src/ModuleName/Fixture',
      )
);

does not work and the fixtures files are not loaded. It should be

return array(
    'doctrine' => array(
        'fixture' => array(
             'ModuleName_fixture' => __DIR__ . '/../src/ModuleName/Fixture',
        )
    ),
);

and then everything works fine.
Please update the documentation :)

Thanks!

Inject ServiceLocator into Fixtures

Would be a nice thing to use configuration to create objects. I would suggest to test, if a Fixture implements ServiceLocatorAwareInterface and set its ServiceLocator before running execute. I can add a PR when I have a bit more time.

Documentation lets you install 0.0.4 and breaks the data-fixure:import command

The documentation says:

$ php composer.phar require hounddog/doctrine-data-fixture-module:0.0.*

Using this command composer will require tag 0.0.4. In that version the configuration is not fetched like the documentation explains.

DoctrineDataFixtureModule\Service\FixtureFactory on 0.0.4

public function getOptions(ServiceLocatorInterface $sl, $key)
{
    $options = $sl->get('Configuration');
    if (!isset($options['data-fixture'])) {
        return array();
    }

    return $options['data-fixture'];
}

DoctrineDataFixtureModule\Service\FixtureFactory on master

public function getOptions(ServiceLocatorInterface $sl, $key)
{
    $options = $sl->get('config');
    if (!isset($options['doctrine']['fixture'])) {
        return array();
    }

    return $options['doctrine']['fixture'];
}

So after following the documentation for installation and configuration you will end up with a command that will not load any fixtures.

Sharing objects between fixtures

Hi all,

is there any way to share object between fixtures. I see ObjectManager have getReference method, but no addReference.

Basically I would like to use some objects in subsequent fixtures...

Thanks.

Enable Packagist auto-update

Yesterday you merged the PR #10, but this update is not yet available to users.
You need to update the module in Packagist.
To do this there are 2 ways:

"Enabling the Packagist service hook ensures that your package will always be updated instantly when you push to GitHub. To do so you can go to your GitHub repository, click the "Admin" button, then "Service Hooks". Pick "Packagist" in the list, and add your API token (see above), plus your Packagist username if it is not the same as on GitHub. Check the "Active" box and submit the form."

$sm->get('doctrine.configuration.fixtures') returns empty paths, import fails

REF: #33

This issue has not resolved.
If you setup the module as in the documentation, the import does not work because within Module.php
$paths = $sm->get('doctrine.configuration.fixtures'); returns an empty array. What actually works is $config = $sm->get('Config'); $paths = $config['data-fixture']; if you adhere to the documentation.

The solution is either update Module.php or update the documentation from

return [
      'data-fixture' => [
            'ModuleName_fixture' => __DIR__ . '/../src/ModuleName/Fixture',
      ]
];

to

return [
    'doctrine' => [
        'fixture' => [
             'ModuleName_fixture' => __DIR__ . '/../src/ModuleName/Fixture',
        ]
    ],
];

FixtureFactory Fails to Retrieve ['doctrine']['fixture'] key from config

Running "data-fixture:import" doesn't do anything for me so I've tracked the problem down to FixtureFactory, which fails to getOptions (empty array returned).

I've noticed that "get('config')" doesn't return keys ['doctrine']['fixture'] so an empty array gets returned on this line: https://github.com/Hounddog/DoctrineDataFixtureModule/blob/master/src/DoctrineDataFixtureModule/Service/FixtureFactory.php#L56 and no fixtures classes are executed.

UPDATE: Sorry, my bad...I've found a config file cached inside vendor folder. Removing cache fixed it.

--purge-with-truncate option fails

When i try to purge data with purge-with-truncate option before insert fixtures, i have a SQL error :

[Doctrine\DBAL\DBALException]                                                                                                                                                                                                             
  An exception occurred while executing 'TRUNCATE table':                                                                                                                                                                      

  SQLSTATE[42000]: Syntax error or access violation: 1701 Cannot truncate a table referenced in a foreign key constraint (`database`.`table`, CONSTRAINT `FK_E75F52F596D36FD` FOREIGN KEY (`foreign_key`) REFE  
  RENCES `database`.`table2` (`id`))                  

A new tag would be welcome :)

Dear all,

As I don't like to extend my minimum-stability to dev, do you think it's feasable to create ร  0.02 version of this package ?

I think this would be valuable as some dependencies have been updated since the last version :)

Thanks a lot,
Greg

Add option to specify entity manager

If you have multiple entity managers, it would be nice to be able to specify your secondary manager with a flag. For instance --em=orm_secondary. The name equals the key in the doctrine module configuration (where the default one is orm_default).

Module doen't import nothing

I tried to use your module with zf 2.3.2dev and when I execute the import command the module delete all my data but, doesn't create anything, that because the command:
$paths = $sm->get('doctrine.configuration.fixtures');
in Module.php doesn't work.
Just change it with:

$config = $sm->get('Config');
$paths = $config['doctrine']['configuration']['fixtures'];

and please change the documentation for the reference of fixture paths.

Add option to specify fixtures

Currently we can only specify a Directory path to the fixtures. We should also be able to specify each fixture as single entities.

Latest doctrine-orm-module compatibilty

Require section of my composer.json is like below:

"require": {
        "php": ">=5.6",
        "zendframework/zendframework": "2.4.0",
        "doctrine/orm": "2.5.0",
        "doctrine/doctrine-module": "dev-master",
        "doctrine/doctrine-orm-module": "dev-master",
        "hounddog/doctrine-data-fixture-module": "dev-master"
    },

and composer update command produces this output:

$ php composer.phar update      
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - hounddog/doctrine-data-fixture-module dev-master requires doctrine/doctrine-orm-module ~0.7 -> no matching package found.
    - hounddog/doctrine-data-fixture-module dev-master requires doctrine/doctrine-orm-module ~0.7 -> no matching package found.
    - Installation request for hounddog/doctrine-data-fixture-module dev-master -> satisfiable by hounddog/doctrine-data-fixture-module[dev-master].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

Currently its impossible to install DoctrineDataFixtureModule and DoctrineORMModule together.

Service manager

How to inject service manager into data fixture. ServiceLocatorAwareInterface doesn't work

<?php

namespace Application\Fixture;

use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use StaticBlock\Entity\StaticBlock;
use Zend\ServiceManager\ServiceLocatorAwareInterface;
use Zend\ServiceManager\ServiceLocatorInterface;

class AddressFixture implements FixtureInterface, ServiceLocatorAwareInterface
{

    protected $serviceLocator;

    public function load(ObjectManager $manager)
    {
        if ($this->getServiceLocator()) {
            die('woohoo there is servicelocator');
        }
        var_dump($this->getServiceLocator());

       // ... personal stuff cut out
    }

    public function setServiceLocator(ServiceLocatorInterface $serviceLocator)
    {
        var_dump('hello assigning service locator');
        $this->serviceLocator = $serviceLocator;
    }


    public function getServiceLocator()
    {
        return $this->serviceLocator;
    }
}

Usage with alternate EntityManager (via: SwissEngine/Doctrine-Module-Extension)

This module ignores the --em=orm_alterante flag provided by SwissEngine/Doctrine-Module-Extension.

After a little debugging this is because the EntityManager is set in the "loadCli.post" event, before the CLI Helper even is made aware of the alternate EntityManager.

I have come up with a quick hack of a solution: Load the EntityManager from the CLI Helper inside the execute() { } function

ie, change:

public function execute(InputInterface $input, OutputInterface $output)
{
        $loader = new ServiceLocatorAwareLoader($this->serviceLocator);
        $purger = new ORMPurger();
        // etc...

to:

public function execute(InputInterface $input, OutputInterface $output)
{
        $em = $this->getHelper('em')->getEntityManager();
        $this->setEntityManager($em);
        $loader = new ServiceLocatorAwareLoader($this->serviceLocator);
        $purger = new ORMPurger();
        // etc  ....

No function in ZF 2.2.2

I try to instal in my zf2 2.2.2 and this error apeared:

Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for hounddog/doctrine-data-fixture-module dev-master -> satisfiable by hounddog/doctrine-data-fixture-module dev-master.
- hounddog/doctrine-data-fixture-module dev-master requires doctrine/data-fixtures dev-master -> no matching package found.

Potential causes:

Read http://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

Installation failed, reverting composer.json to its original content.

What i need to do??

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.