{"id":37006617,"url":"https://github.com/andreas-glaser/dc-event-bundle","last_synced_at":"2026-01-14T00:45:42.244Z","repository":{"id":56947783,"uuid":"42847161","full_name":"andreas-glaser/dc-event-bundle","owner":"andreas-glaser","description":"This bundle attaches a custom doctrine event handler during preFlush, allowing you to persist, update and remove entities while having access to change sets.","archived":true,"fork":false,"pushed_at":"2018-12-07T05:35:18.000Z","size":47,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"1.2","last_synced_at":"2025-05-29T18:57:12.454Z","etag":null,"topics":["doctrine","doctrine-orm","event-handlers"],"latest_commit_sha":null,"homepage":"https://github.com/andreas-glaser/dc-event-bundle/","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/andreas-glaser.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":"2015-09-21T06:08:45.000Z","updated_at":"2023-10-12T22:41:41.000Z","dependencies_parsed_at":"2022-08-21T03:10:25.527Z","dependency_job_id":null,"html_url":"https://github.com/andreas-glaser/dc-event-bundle","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/andreas-glaser/dc-event-bundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreas-glaser%2Fdc-event-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreas-glaser%2Fdc-event-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreas-glaser%2Fdc-event-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreas-glaser%2Fdc-event-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andreas-glaser","download_url":"https://codeload.github.com/andreas-glaser/dc-event-bundle/tar.gz/refs/heads/1.2","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreas-glaser%2Fdc-event-bundle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28406535,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["doctrine","doctrine-orm","event-handlers"],"created_at":"2026-01-14T00:45:42.092Z","updated_at":"2026-01-14T00:45:42.234Z","avatar_url":"https://github.com/andreas-glaser.png","language":"PHP","readme":"# DCEventBundle - Doctrine Custom Event Bundle\n\nThis bundle attaches an event handler during preFlush, allowing you to persist, update and remove entities while having access to change sets.\n\n## Installation\n```bash\ncomposer require andreas-glaser/dc-event-bundle ^1\n```\n\n## Usage\n\n### 1.) Attach entity event listener\n```php\n\u003c?php\n\nnamespace AppBundle\\Entity;\n\nuse AndreasGlaser\\DCEventBundle\\EventHandler\\Annotations\\DCEntityEventHandler;\nuse Doctrine\\ORM\\Mapping as ORM;\n\n/**\n * Article\n *\n * @ORM\\Table(name=\"article\")\n * @ORM\\Entity(repositoryClass=\"AppBundle\\Repository\\ArticleRepository\")\n * @DCEntityEventHandler(class=\"AppBundle\\EEH\\ArticleEEH\")\n */\nclass Article\n{\n    /**\n     * @var int\n     *\n     * @ORM\\Column(name=\"id\", type=\"integer\")\n     * @ORM\\Id\n     * @ORM\\GeneratedValue(strategy=\"AUTO\")\n     */\n    private $id;\n\n    /**\n     * @var string\n     *\n     * @ORM\\Column(name=\"subject\", type=\"string\", length=255)\n     */\n    private $subject;\n\n    /**\n     * @var string\n     *\n     * @ORM\\Column(name=\"body\", type=\"text\", nullable=true)\n     */\n    private $body;\n\n    /**\n     * Get id\n     *\n     * @return int\n     */\n    public function getId()\n    {\n        return $this-\u003eid;\n    }\n\n    /**\n     * Set subject\n     *\n     * @param string $subject\n     *\n     * @return Article\n     */\n    public function setSubject($subject)\n    {\n        $this-\u003esubject = $subject;\n\n        return $this;\n    }\n\n    /**\n     * Get subject\n     *\n     * @return string\n     */\n    public function getSubject()\n    {\n        return $this-\u003esubject;\n    }\n\n    /**\n     * Set body\n     *\n     * @param string $body\n     *\n     * @return Article\n     */\n    public function setBody($body)\n    {\n        $this-\u003ebody = $body;\n\n        return $this;\n    }\n\n    /**\n     * Get body\n     *\n     * @return string\n     */\n    public function getBody()\n    {\n        return $this-\u003ebody;\n    }\n}\n```\n\n### 2.) Create entity event handler\n```php\n\u003c?php\n\nnamespace AppBundle\\EEH;\n\nuse AndreasGlaser\\DCEventBundle\\EventHandler\\DCEntityEventHandlerBase;\nuse AndreasGlaser\\DCEventBundle\\Helper\\ChangeSetHelper;\nuse AppBundle\\Entity as AppBundleEntity;\n\n/**\n * Class ArticleEEH\n *\n * @package AppBundle\\EEH\n */\nclass ArticleEEH extends DCEntityEventHandlerBase\n{\n    /**\n     * @var AppBundleEntity\\Article\n     */\n    protected $entity;\n    \n    /**\n     * @return void\n     */\n    public function prePersist()\n    {\n        // TODO: Implement prePersist() method.\n    }\n\n    /**\n     * @return void\n     */\n    public function postPersist()\n    {\n        // TODO: Implement postPersist() method.\n    }\n\n    /**\n     * @param \\AndreasGlaser\\DCEventBundle\\Helper\\ChangeSetHelper $changeSet\n     *\n     * @return void\n     */\n    public function preUpdate(ChangeSetHelper $changeSet)\n    {\n        // TODO: Implement preUpdate() method.\n    }\n\n    /**\n     * @return void\n     */\n    public function postUpdate()\n    {\n        // TODO: Implement postUpdate() method.\n    }\n\n    /**\n     * @return void\n     */\n    public function preRemove()\n    {\n        // TODO: Implement preRemove() method.\n    }\n\n    /**\n     * @return void\n     */\n    public function postRemove()\n    {\n        // TODO: Implement postRemove() method.\n    }\n}\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreas-glaser%2Fdc-event-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreas-glaser%2Fdc-event-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreas-glaser%2Fdc-event-bundle/lists"}