{"id":19199965,"url":"https://github.com/fusic/reincarnation","last_synced_at":"2026-05-15T05:17:11.422Z","repository":{"id":1220308,"uuid":"41902327","full_name":"fusic/Reincarnation","owner":"fusic","description":"Use version 1.1.x for Cake3.3 and below","archived":false,"fork":false,"pushed_at":"2023-11-16T07:25:35.000Z","size":113,"stargazers_count":3,"open_issues_count":1,"forks_count":3,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-12T17:16:47.643Z","etag":null,"topics":[],"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/fusic.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}},"created_at":"2015-09-04T07:01:01.000Z","updated_at":"2022-03-17T12:55:38.000Z","dependencies_parsed_at":"2023-11-14T02:46:20.262Z","dependency_job_id":null,"html_url":"https://github.com/fusic/Reincarnation","commit_stats":{"total_commits":56,"total_committers":9,"mean_commits":6.222222222222222,"dds":0.625,"last_synced_commit":"b57d386d05c82f097d2d70615ed48d4097e9898a"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fusic%2FReincarnation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fusic%2FReincarnation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fusic%2FReincarnation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fusic%2FReincarnation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fusic","download_url":"https://codeload.github.com/fusic/Reincarnation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253173872,"owners_count":21865766,"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-09T12:29:45.231Z","updated_at":"2026-05-15T05:17:11.393Z","avatar_url":"https://github.com/fusic.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reincarnation\n\n## Description\n\nSoft delete plugin for CakePHP 5.x.\n\n## Requirements\n\n- PHP \u003e= 8.1.*\n- CakePHP \u003e= 5.*\n\n## Installation\n\n```\n$ composer install\n```\n\n# Usage\n\n Create users table.\n\n```sql\n\nCREATE TABLE users\n(\n  id serial NOT NULL,\n  username text,\n  password text,\n  created timestamp without time zone,\n  modified timestamp without time zone,\n  delete_flg boolean DEFAULT false,\n  deleted timestamp with time zone,\n  CONSTRAINT users_pkey PRIMARY KEY (id)\n)\nWITH (\n  OIDS=FALSE\n);\n```\n\n UsersTable.php\n\n```php\nclass UsersTable extends Table\n{\n    public function initialize(array $config)\n    {\n        // Case 1\n        // default\n        //   table field name\n        //     boolean:deleted\n        //     timestamp:delete_date\n        $this-\u003eaddBehavior('Reincarnation.SoftDelete');\n\n        // Case 2\n        // field name custom\n        //   table field name\n        //     boolean:delete_flg\n        //     timestamp:deleted\n        $this-\u003eaddBehavior('Reincarnation.SoftDelete', ['boolean' =\u003e 'delete_flg', 'timestamp' =\u003e 'deleted']);\n\n        // Case 3\n        // boolean only\n        //   table field name\n        //     boolean:delete_flg\n        //     timestamp:none\n        $this-\u003eaddBehavior('Reincarnation.SoftDelete', ['boolean' =\u003e 'delete_flg', 'timestamp' =\u003e false]);\n\n        // Case 4\n        // timestamp only\n        //   table field name\n        //     boolean:none\n        //     timestamp:deleted\n        $this-\u003eaddBehavior('Reincarnation.SoftDelete', ['boolean' =\u003e false, 'timestamp' =\u003e 'deleted']);\n    }\n}\n```\n\n UsersController.php\n\n```php\nclass UsersController extends AppController\n{\n    public function delete($id = null)\n    {\n        $this-\u003erequest-\u003eallowMethod(['post', 'delete']);\n        $user = $this-\u003eUsers-\u003eget($id);\n        if ($this-\u003eUsers-\u003esoftDelete($user)) {\n        //第二引数がtrueの場合、Entityのassociate先もあわせて削除します\n        //if ($this-\u003eUsers-\u003esoftDelete($user, true)) {\n            $this-\u003eFlash-\u003esuccess(__('The data has been deleted.'));\n        } else {\n            $this-\u003eFlash-\u003eerror(__('The data could not be deleted. Please, try again.'));\n        }\n        return $this-\u003eredirect('action' =\u003e 'index');\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffusic%2Freincarnation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffusic%2Freincarnation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffusic%2Freincarnation/lists"}