{"id":19662148,"url":"https://github.com/leongersen/entity-generator","last_synced_at":"2025-10-24T01:48:57.817Z","repository":{"id":44205691,"uuid":"231733767","full_name":"leongersen/entity-generator","owner":"leongersen","description":"Database-first Doctrine entity generator with oneToMany and manyToOne support","archived":false,"fork":false,"pushed_at":"2024-11-06T20:39:06.000Z","size":32,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T11:11:09.856Z","etag":null,"topics":["doctrine","doctrine-orm","entity","php7"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leongersen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-04T08:43:40.000Z","updated_at":"2024-11-28T14:34:14.000Z","dependencies_parsed_at":"2022-08-30T14:50:36.857Z","dependency_job_id":null,"html_url":"https://github.com/leongersen/entity-generator","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leongersen%2Fentity-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leongersen%2Fentity-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leongersen%2Fentity-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leongersen%2Fentity-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leongersen","download_url":"https://codeload.github.com/leongersen/entity-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251391244,"owners_count":21582133,"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":["doctrine","doctrine-orm","entity","php7"],"created_at":"2024-11-11T16:09:46.143Z","updated_at":"2025-10-24T01:48:57.754Z","avatar_url":"https://github.com/leongersen.png","language":"PHP","readme":"# Entity Generator\n\nThe Doctrine Project [will be removing support for generating entities](https://github.com/symfony/symfony-docs/issues/8893) in Doctrine 3.\n\nNot all development workflows will fit the proposed entity-first database management strategy.\n\nTo keep supporting a database-first workflow this project implements an alternative database oriented entity generator. \n\n## Features\n- Generate entities with type annotations, getters, setters, adders and removers;\n- Supports `oneToMany` and `manyToOne` relationships, including pluralization of properties and methods.\n\n## License\nThis project is licensed [MIT](https://choosealicense.com/licenses/mit/) and can be used for free in any personal or commercial project.\n\n## Usage\n```shell script\nbin/entity-generator entity-generator:generate\n```\n\n### Options\n- `dsn` Accepts the same format as Doctrine, so the value configured in `.env` can be used\n- `namespace` Namespace for the generated entities (Default `App\\Entity`)\n- `directory` Output directory for the generated entities (Default `src/Entity`)\n- `collection-interface` Interface name for the collection type to use in the generated entities (Default `\\Doctrine\\Common\\Collections\\Collection`)\n- `collection-implementation` (Default `\\Doctrine\\Common\\Collections\\ArrayCollection`)\n\n### Using a DSN from a .env file \n```shell script\nsource .env\nbin/entity-generator entity-generator:generate --dsn $DATABASE_URL\n```\n\n## Implementation\n- A mapping is generated from an existing database using `SHOW CREATE TABLE`.\n- Entity classes are rendered using a Twig template.\n\n## Limitations\n- Only provides a `\\PDO` based driver and an mapper for `MySQL`-like sql dialects. \n- Annotations for (unique) indexes are not (yet) implemented\n- `ManyToMany` relations are not (yet) supported ([motivation](https://stackoverflow.com/questions/18655286/doctrine-2-how-to-handle-join-tables-with-extra-columns))\n- Doctrine Custom types are not supported\n\n## Open issues\n- Naming conflicts on `xyx_id` with a foreign key and field `xyx` (both become `xyz`)\n- Naming conflicts on multiple foreign keys from one table to another (`xyz.abc_1_id` and `xyz.abc_2_id` both become `xyz.abcs`) \n- Blobs are not yet implemented\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleongersen%2Fentity-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleongersen%2Fentity-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleongersen%2Fentity-generator/lists"}