{"id":17343446,"url":"https://github.com/firesphere/silverstripe-gridfield-relation-handler","last_synced_at":"2025-04-14T20:10:45.084Z","repository":{"id":57050855,"uuid":"64705568","full_name":"Firesphere/silverstripe-gridfield-relation-handler","owner":"Firesphere","description":null,"archived":false,"fork":false,"pushed_at":"2020-04-14T03:29:06.000Z","size":7,"stargazers_count":1,"open_issues_count":4,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-06T20:52:01.513Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Firesphere.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-01T22:21:14.000Z","updated_at":"2020-10-03T23:05:32.000Z","dependencies_parsed_at":"2022-08-24T03:40:59.852Z","dependency_job_id":null,"html_url":"https://github.com/Firesphere/silverstripe-gridfield-relation-handler","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firesphere%2Fsilverstripe-gridfield-relation-handler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firesphere%2Fsilverstripe-gridfield-relation-handler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firesphere%2Fsilverstripe-gridfield-relation-handler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firesphere%2Fsilverstripe-gridfield-relation-handler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Firesphere","download_url":"https://codeload.github.com/Firesphere/silverstripe-gridfield-relation-handler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240245894,"owners_count":19771028,"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":["hacktoberfest"],"created_at":"2024-10-15T16:09:26.233Z","updated_at":"2025-02-25T23:33:51.596Z","avatar_url":"https://github.com/Firesphere.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## GridFieldRelationHandler\n\nThis module provides two [`GridField`](http://doc.silverstripe.org/framework/en/topics/grid-field) components\nthat aid in managing relationships within [SilverStripe](http://www.silverstripe.org). The \n[`GridFieldHasOneRelationHandler`](#gridfieldhasonerelationhandler) component allows a `SS_List` to be used to select the value of a has_one\nrelation and the [`GridFieldManyRelationHandler`](#gridfieldmanyrelationhandler) component manages a `RelationList`.\n\n## Installation ##\n\nIf the version of SilverStripe you are running is earlier than 3.0.3, first apply [this patch](https://github.com/silverstripe/sapphire/commit/d2b4e0df01f82fdbe613890c8ae909af404640a5) to `GridFieldPaginator`.\n\nDownload this module and extract it into your site's root folder. Flush your site's manifest by visiting\nhttp://yoursite.com/?flush=1. These components are now ready for use.\n\n## GridFieldHasOneRelationHandler ##\n\n![](https://files.app.net/zb9sU5vs.png)\n\nThe `GridFieldHasOneRelationHandler` component provides radio buttons for selecting the object that the\nhas_one points to. Its constructor takes the object the relation exists on, the name of the relation and\nan optional target fragment which describes the position of the save relation button.\n\n### Example ###\n\n\t:::php\n\t$config-\u003eaddComponent(new GridFieldHasOneRelationHandler($this, 'MainImage'));\n\n## GridFieldManyRelationHandler ##\n\n![](https://files.app.net/zb9r7VqE.png)\n\nThe `GridFieldManyRelationHandler` component provides check boxes for selecting the objects that a\nhas_many or many_many point to. Its constructor takes an optional target fragment which describes\nthe position of the save relation button.\n\nIf your `GridField` also has a `GridFieldPaginator` component, this component must be inserted before\nit for the pagination to work properly.\n\n### Example ###\n\n\t:::php\n\t// The second argument here ensures that this component is placed before any GridFieldPaginator\n\t$config-\u003eaddComponent(new GridFieldManyRelationHandler(), 'GridFieldPaginator');\n\n## License ##\n\t\n\tCopyright (c) 2014, Simon Welsh - simon.geek.nz\n\tAll rights reserved.\n\n\tRedistribution and use in source and binary forms, with or without\n\tmodification, are permitted provided that the following conditions are met:\n\t    * Redistributions of source code must retain the above copyright\n\t      notice, this list of conditions and the following disclaimer.\n\t    * Redistributions in binary form must reproduce the above copyright\n\t      notice, this list of conditions and the following disclaimer in the\n\t      documentation and/or other materials provided with the distribution.\n\t    * The name of Simon Welsh may not be used to endorse or promote products\n\t      derived from this software without specific prior written permission.\n\n\tTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n\tANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n\tWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n\tDISCLAIMED. IN NO EVENT SHALL \u003cCOPYRIGHT HOLDER\u003e BE LIABLE FOR ANY\n\tDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n\t(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n\tLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n\tON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n\t(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n\tSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiresphere%2Fsilverstripe-gridfield-relation-handler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffiresphere%2Fsilverstripe-gridfield-relation-handler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiresphere%2Fsilverstripe-gridfield-relation-handler/lists"}