{"id":23218815,"url":"https://github.com/schvoy/base-entity-bundle","last_synced_at":"2026-03-06T00:10:43.957Z","repository":{"id":50681251,"uuid":"277650509","full_name":"schvoy/base-entity-bundle","owner":"schvoy","description":"A bundle which provides base doctrine entities and behaviors for Symfony projects.","archived":false,"fork":false,"pushed_at":"2026-03-05T17:45:31.000Z","size":81,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-05T20:25:46.044Z","etag":null,"topics":["bundle","doctrine","php","symfony","symfony-bundle"],"latest_commit_sha":null,"homepage":"","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/schvoy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2020-07-06T21:16:07.000Z","updated_at":"2026-03-05T17:45:35.000Z","dependencies_parsed_at":"2024-06-01T23:05:25.274Z","dependency_job_id":"135c424a-42a6-44da-a71c-69db90310ec2","html_url":"https://github.com/schvoy/base-entity-bundle","commit_stats":{"total_commits":6,"total_committers":2,"mean_commits":3.0,"dds":"0.16666666666666663","last_synced_commit":"cac159c80651c9122af2ef06cdd630b6fa83930c"},"previous_names":["schvoy/base-entity-bundle"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/schvoy/base-entity-bundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schvoy%2Fbase-entity-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schvoy%2Fbase-entity-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schvoy%2Fbase-entity-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schvoy%2Fbase-entity-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schvoy","download_url":"https://codeload.github.com/schvoy/base-entity-bundle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schvoy%2Fbase-entity-bundle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30156259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T22:39:40.138Z","status":"ssl_error","status_checked_at":"2026-03-05T22:39:24.771Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bundle","doctrine","php","symfony","symfony-bundle"],"created_at":"2024-12-18T21:17:58.997Z","updated_at":"2026-03-06T00:10:43.940Z","avatar_url":"https://github.com/schvoy.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Base entity bundle\n\nA bundle which provides base doctrine entities and behaviors for Symfony projects.\n\n## Installation\n\n```bash\ncomposer require schvoy/base-entity-bundle\n```\n\n## Usage\n\n### Use base entities as Mapped Superclass\n\n```php\nclass \u003cyour-entity-name\u003e extends UuidBasedEntity\n```\n\n```php\nclass \u003cyour-entity-name\u003e extends UlidBasedEntity\n```\n\n```php\nclass \u003cyour-entity-name\u003e extends IdBasedEntity\n```\n\n**All of them provide commonly used entity functionalities:**\n\n* `$id` property with getId() / setId() method - the value based on the class name can be integer, Uuid or Ulid\n* Timestampable behavior\n    * `$createdAt`\n    * `$updatedAt`\n* SoftDeleteable behavior\n    * `$deletedAt`\n* Blameable behavior\n    * `$createdBy`\n    * `$updatedBy`\n    * `$deletedBy`\n\n### Only traits? Yes\n\nIf you don't want to use the Mapped Superclasses? Than you can use only the traits.\nIn this case you can extend your entity classes with the traits what you want to use.\n\n```php\n# Id entity traits\nuse IdBasedEntityTrait;\nuse UuidBasedEntityTrait;\nuse UliddBasedEntityTrait;\n\n# Doctrine Behavior traits\nuse BlameableTrait;\nuse SoftDeleteableTrait;\nuse TimestampableTrait;\n```\n\n\n## Doctrine behavior\n\nOriginally this package used the `KnpLabs/DoctrineBehaviors`, but there is/was a [maintainer issue](https://github.com/KnpLabs/DoctrineBehaviors/issues/711).\nTherefore this bundle contains a new implementation of the most generally used behaviors, based on the original package.\n\n\u003e The implementation is not 100% equivalent to the original package.\n\nDoctrine listeners for the behavior events are loaded automatically, but for the Blameable behavior you have to define\nwhich one is your User class (check the configuration part).\n\nThere are built-in implementations of the behavior interfaces attached to the base entities, but you can define your own if you want.\n\n### Timestampable\n\nTimestampable handle the createdAt and updatedAt fields during persist and update.\n\nYour entity have to implement the `Schvoy\\BaseEntityBundle\\Entity\\Interfaces\\Behavior\\TimestampableInterface`. \n\n### SoftDeleteable\n\nThe behavior keeps the data in the database without real data removal, it is just set the deletedAt value on the entity.\n\nThis bundle provides extra helping methods for this behavior on the entity:\n\n- delete()\n- restore()\n- isDeleted()\n- willBeDeleted()\n\nYour entity have to implement the `Schvoy\\BaseEntityBundle\\Entity\\Interfaces\\Behavior\\SoftdeletableInterface`.\n\n### Blameable\n\nTracks who did the changes on the entity during persist, update or remove (working only with soft delete).\n\nWhen the entity implements the `Schvoy\\BaseEntityBundle\\Entity\\Interfaces\\Behavior\\BlamableInterface` then the createdBy\nand updatedBy field are tracked during persist and update by default.\n\nTo track also the deletedBy during remove, your entity have to implements the `Schvoy\\BaseEntityBundle\\Entity\\Interfaces\\Behavior\\SoftdeletableInterface`.\n\n\u003e The deletedBy field will be added to the entity even if the SoftDeleteable behavior is not used, but it will be always null.\n\n## Configuration reference\n\nRequired config fo Blameable behavior\n\n```yaml\ndoctrine:\n    orm:\n        resolve_target_entities:\n            Symfony\\Component\\Security\\Core\\User\\UserInterface: Your\\Namespace\\User\n```\n\n\u003e More information: https://symfony.com/doc/current/doctrine/resolve_target_entity.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschvoy%2Fbase-entity-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschvoy%2Fbase-entity-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschvoy%2Fbase-entity-bundle/lists"}