{"id":17718337,"url":"https://github.com/fabiang/doctrine-dynamic","last_synced_at":"2025-10-04T06:37:30.889Z","repository":{"id":56980970,"uuid":"44551888","full_name":"fabiang/doctrine-dynamic","owner":"fabiang","description":"Load Doctrine mappings dynamically for your entities by configuration","archived":false,"fork":false,"pushed_at":"2024-11-26T12:03:56.000Z","size":94,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-08-30T12:27:16.468Z","etag":null,"topics":["doctrine","doctrine-extension","orm","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fabiang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2015-10-19T17:35:20.000Z","updated_at":"2024-11-26T12:02:09.000Z","dependencies_parsed_at":"2025-08-30T12:17:49.028Z","dependency_job_id":"4b37ab2a-c22d-4fbe-8c68-7cccd3e46cb0","html_url":"https://github.com/fabiang/doctrine-dynamic","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/fabiang/doctrine-dynamic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiang%2Fdoctrine-dynamic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiang%2Fdoctrine-dynamic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiang%2Fdoctrine-dynamic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiang%2Fdoctrine-dynamic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabiang","download_url":"https://codeload.github.com/fabiang/doctrine-dynamic/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiang%2Fdoctrine-dynamic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278277859,"owners_count":25960428,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["doctrine","doctrine-extension","orm","php"],"created_at":"2024-10-25T14:44:52.161Z","updated_at":"2025-10-04T06:37:30.849Z","avatar_url":"https://github.com/fabiang.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fabiang/doctrine-dynamic\n\nProxy Driver for [Doctrine](http://doctrine-project.org/) which allows you to add\ncustom relations dynamically by configuration.\n\nThis is useful if you use foreign entities, which you can't change, but you like\nto add own relations between them and your entities.\n\n[![Latest Stable Version](https://poser.pugx.org/fabiang/doctrine-dynamic/version)](https://packagist.org/packages/fabiang/doctrine-dynamic)\n[![License](https://poser.pugx.org/fabiang/doctrine-dynamic/license)](https://packagist.org/packages/fabiang/doctrine-dynamic)  \n[![CI](https://github.com/fabiang/doctrine-dynamic/actions/workflows/ci.yml/badge.svg)](https://github.com/fabiang/doctrine-dynamic/actions/workflows/ci.yml)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/fabiang/doctrine-dynamic/badges/quality-score.png?b=main)](https://scrutinizer-ci.com/g/fabiang/doctrine-dynamic/?branch=main)\n[![Code Coverage](https://scrutinizer-ci.com/g/fabiang/doctrine-dynamic/badges/coverage.png?b=main)](https://scrutinizer-ci.com/g/fabiang/doctrine-dynamic/?branch=main)\n\n## Features\n\n* Setting all possible relations to entities:\n  * OneToOne\n  * ManyToOne\n  * OneToMany\n  * ManyToMany\n* Setting repository class\n\n## Installation\n\nNew to Composer? Read the [introduction](https://getcomposer.org/doc/00-intro.md#introduction). Run the following Composer command:\n\n```console\n$ composer require fabiang/doctrine-dynamic\n```\n\n## Framework integration\n\n* [Laminas](https://github.com/fabiang/doctrine-dynamic-laminas)\n\n## Usage\n\n```php\n\u003c?php\n\nuse Fabiang\\DoctrineDynamic\\ConfigurationFactory;\nuse Fabiang\\DoctrineDynamic\\ProxyDriverFactory;\nuse Doctrine\\ORM\\EntityManager;\n\n$configurationFactory = new ConfigurationFactory();\n$configuration = $configurationFactory-\u003efactory([\n    \\Mymodule\\Entity\\Customer::class =\u003e [\n        'options' =\u003e [\n            'repository' =\u003e \\Mymodule\\Repository\\CustomerRepository::class,\n        ],\n        'fields' =\u003e [\n            'fieldname' =\u003e [\n                'products' =\u003e [\n                    'oneToMany' =\u003e [\n                        [\n                            'targetEntity' =\u003e \\Mymodule\\Entity\\Customer::class,\n                            'mappedBy'     =\u003e 'customer',\n                        ],\n                    ]\n                ],\n            ]\n        ]\n    ],\n    \\Mymodule\\Entity\\Products::class =\u003e [\n        'fields' =\u003e [\n            'customer' =\u003e [\n                'manyToOne' =\u003e [\n                    [\n                        'targetEntity' =\u003e \\Mymodule\\Entity\\Products::class,\n                        'inversedBy'   =\u003e 'products',\n                        'joinColumns'  =\u003e [\n                            'name'                 =\u003e 'customer_id',\n                            'referencedColumnName' =\u003e 'id'\n                        ]\n                    ],\n                ]\n            ],\n        ]\n    ],\n]);\n\n/** @var $entityManager EntityManager */\n// get it from a container for example\n$entityManager = $container-\u003eget(EntityManager::class);\n\n$proxyDriverFactory = new ProxyDriverFactory();\n$proxyDriverFactory-\u003efactory($entityManager, $configuration);\n```\n\n## Development\n\nThis library is tested with [PHPUnit](https://phpunit.de/) and [Behat](http://behat.org/).\n\nFork the project on Github and send an pull request with your changes.\nMake sure you didn't break anything with running the following commands:\n\n```console\ncomposer install\n./vendor/bin/phpunit\n./vendor/bin/behat\n```\n\n## Licence\n\nBSD-2-Clause. See the [LICENSE.md](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiang%2Fdoctrine-dynamic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabiang%2Fdoctrine-dynamic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiang%2Fdoctrine-dynamic/lists"}