{"id":18789112,"url":"https://github.com/youwegit/data-dictionary","last_synced_at":"2025-04-13T13:32:24.337Z","repository":{"id":45027532,"uuid":"152272199","full_name":"YouweGit/data-dictionary","owner":"YouweGit","description":"Pimcore data dictionary","archived":false,"fork":false,"pushed_at":"2022-01-13T13:01:26.000Z","size":177,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-11T05:46:57.219Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YouweGit.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":"2018-10-09T15:07:05.000Z","updated_at":"2022-08-03T22:39:32.000Z","dependencies_parsed_at":"2022-09-05T09:40:40.334Z","dependency_job_id":null,"html_url":"https://github.com/YouweGit/data-dictionary","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YouweGit%2Fdata-dictionary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YouweGit%2Fdata-dictionary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YouweGit%2Fdata-dictionary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YouweGit%2Fdata-dictionary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YouweGit","download_url":"https://codeload.github.com/YouweGit/data-dictionary/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248721290,"owners_count":21151075,"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-07T21:06:41.908Z","updated_at":"2025-04-13T13:32:23.673Z","avatar_url":"https://github.com/YouweGit.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Data Dictionary\n======\nCreates a diagram of the current datamodel inside Pimcore.\n\n![Sceenshot](https://image.ibb.co/mRmAgL/Screenshot-2018-10-17-at-23-46-00.png)\n\n## Install\n\nInstall the bundle with composer, go to the directory of the project and run the following command:\n\n```\nCOMPOSER_MEMORY_LIMIT=3G composer require youwe/data-dictionary\n```\n\nAnd then enable the bundle:\n\n```\n./bin/console pimcore:bundle:install DataDictionaryBundle\n```\n\nAnd youre done!\n\n#### First interface: Visitor\n\nNice, so the next step is to create a class that implements the interface:\n\n```php\nnamespace DataDictionaryBundle\\Graph\\Interfaces;\n\n\ninterface Visitor\n{\n    public function setFieldDefinition($object);\n\n    public function setClassDefinition(\\Pimcore\\Model\\DataObject\\ClassDefinition $object);\n\n    public function setGraph(Graph $graph);\n\n    public function getGraph():Graph;\n\n    public function visit();\n}\n\n```\n\nIn this class you will be able to change the graph that you will receive through the **setGraph** method. Before calling the **visit** method, the data dictionary will provide the field definition (**setFieldDefinition**), the class definition (**setClassDefinition**) and the graph. \n\nWe encourage you to implement those in separated class, and not in your main DataType class. \n\nYou can also extend the class\n```php\n\\DataDictionaryBundle\\Graph\\Visitor\\AbstractVisitor\n```\nThat implements all the methods from the interface except the method **visit**, you will have in this class the following properties:\n```php\n    protected $graph;\n    protected $fieldDefinition;\n    protected $classDefinition;\n```\n\n#### Second interface: DataDictionary\n\nAfter you implement your visitor class, you will have to indicate how to load it, so you will have to implement an interface that will give us a method to recover your class.\n\n```php\nnamespace DataDictionaryBundle\\Interfaces;\n\nuse DataDictionaryBundle\\Graph\\Interfaces\\Visitor;\n\ninterface DataDictionary\n{\n    public static function getVisitor(string $className = null):Visitor;\n\n    public static function canVisit(string $className):bool;\n}\n```\n\nThe method **getVisitor** receive as parameter the class name of the field definition that should be visited by the data dictionary.\n\n### Edit the services.yml to enable it\n\nIn the services.yml file you should add:\n\n```\nservices:\n    datadictionary.defaultclass: #some identifier\n        class: DataDictionaryBundle\\Graph\\Visitor\\Factory\\DefaultClass #the class that implements the DataDictionary interface\n        public: true\n        autowiring: true\n        autoconfigure: true\n        tags: ['datadictionary'] #and this tag will allow us to load your class automaticaly\n\n```\n\n## Results\n\nYou can get the data dictionary by going to the setting (gear icon) -\u003e Show Current Data Dictionary. Then a new tab wil be opened with the data dictionary.\n\nOr you can get the data dictionary directly going to the following URL: \n[http://\u003clocalhost\u003e/admin/data-dictionary/](http://\u003clocalhost\u003e/admin/data-dictionary)\n\nRemember to change the *localhost* to your own pimcore host name.\n\n\n## Todo\n- [ ] Create a diagram with all the classes, attributes and relations;\n    - [x] Classes;\n    - [x] Attributes;\n    - [x] Relations (basic);  \n    - [ ] Create specific elements for specific cases:\n        - [x] Localized fields;\n        - [x] Object Bridge\n        - [x] Bricks\n        - [ ] Block;\n        - [ ] Field collection;\n        - [ ] Tables;\n        - [ ] Classificationstore\n- [ ] Generate textual documentation;\n    - [ ] Create links between the diagram and the documentation;\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyouwegit%2Fdata-dictionary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyouwegit%2Fdata-dictionary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyouwegit%2Fdata-dictionary/lists"}