{"id":19004904,"url":"https://github.com/codeedu/zendexpr-doctrine-fixture","last_synced_at":"2025-04-22T18:50:13.805Z","repository":{"id":56955047,"uuid":"60741049","full_name":"codeedu/zendexpr-doctrine-fixture","owner":"codeedu","description":"Zend Expressive Library that provides Doctrine Data-Fixture functionality","archived":false,"fork":false,"pushed_at":"2020-06-08T23:48:50.000Z","size":14,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-12T18:16:26.661Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeedu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-09T00:56:56.000Z","updated_at":"2020-06-08T23:48:08.000Z","dependencies_parsed_at":"2022-08-21T08:50:20.883Z","dependency_job_id":null,"html_url":"https://github.com/codeedu/zendexpr-doctrine-fixture","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeedu%2Fzendexpr-doctrine-fixture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeedu%2Fzendexpr-doctrine-fixture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeedu%2Fzendexpr-doctrine-fixture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeedu%2Fzendexpr-doctrine-fixture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeedu","download_url":"https://codeload.github.com/codeedu/zendexpr-doctrine-fixture/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250302825,"owners_count":21408464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T18:25:15.695Z","updated_at":"2025-04-22T18:50:13.785Z","avatar_url":"https://github.com/codeedu.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/codeedu/zendexpr-doctrine-fixture.svg?branch=master)](https://travis-ci.org/codeedu/zendexpr-doctrine-fixture)\n\n## About\n\nThis library provides integration with Zend Expressive and Doctrine Data Fixture. Also support PSR-11.\n\n\n## Get started\n\n##### Instalation\n```sh\ncomposer require codeedu/zendexpr-doctrine-fixture:0.1.1\n```\n\n##### Registering Fixtures\n\nTo register fixtures add the fixtures in your configuration.\n\n```php\n[\n      'doctrine' =\u003e [\n            'fixture' =\u003e [\n                  'MyFixtures' =\u003e __DIR__ . '/../src/Fixture',\n            ]\n      ]\n];\n```\n\nRegister factory to create the command:\n\n```php\n[\n      'factories' =\u003e [\n         'doctrine:fixtures_cmd:load'   =\u003e \\CodeEdu\\FixtureFactory::class\n      ]\n];\n```\n\nWe suggest to configure Doctrine ORM and commands with Zend Expressive using this [gist](https://gist.github.com/argentinaluiz/a14df7b1ef73cc111b280e417f84ba92).\nThis configuration uses [DoctrineModule](https://github.com/doctrine/DoctrineModule). DoctrineModule provides easily configuration to integration Doctrine ORM in\nZend Framework 2 Applications, so the approach is enjoy it.\n\nNow in **doctrine.config.php**, so add **doctrine:fixtures_cmd:load** to:\n ```php\n $command = [\n    //.....,\n    'doctrine:fixtures_cmd:load'\n ];\n ```\n\n## Usage\n\n#### Command Line\nAccess the Doctrine command line as following\n\n#### Import\n```sh\n./vendor/bin/doctrine-module data-fixture:import\n```\n\n## Dependency Injection with Fixtures\n\nThis library provides inject the service container in fixtures. So add interface **FixtureContainerInterface**, see below:\n\n```php\nclass MyFixture implements FixtureInterface, FixtureContainerInterface\n{\n    private $container;\n\n    public function load(ObjectManager $manager){\n        $myService = $this-\u003econtainer-\u003eget(MyService::class);\n    }\n\n    public function getContainer()\n    {\n        return $this-\u003econtainer;\n    }\n\n    public function setContainer(ContainerInterface $container)\n    {\n        $this-\u003econtainer = $container;\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeedu%2Fzendexpr-doctrine-fixture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeedu%2Fzendexpr-doctrine-fixture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeedu%2Fzendexpr-doctrine-fixture/lists"}