PHP code example of springworks / entity-diagrams

1. Go to this page and download the library: Download springworks/entity-diagrams library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

springworks / entity-diagrams example snippets



/**
 * entity-diagrams.php
 *
 * Optional manual config to create custom groupings of sections/category groups/globals/user groups/tag groups/asset volumes/products
 * to create entity diagrams of related parts of the system
 */

use craft\helpers\App;

return [
    'docGroups' => [ // Create predefined groups of elements to show in a diagram, 'name' => config array
    ],
    'options' => [ // default options, overridden by docGroups and UI
        '


/**
 * entity-diagrams.php
 *
 * Optional manual config to create custom groupings of sections/category groups/globals/user groups/tag groups/asset volumes/products
 * to create entity diagrams of related parts of the system
 */

use craft\helpers\App;

return [
    'docGroups' => [ // Create predefined groups of elements to show in a diagram, 'name' => config array
        'Group Name' => [
            'sections' => [ // list all section handles to              'siteSettings',
            ],
            'tags' => [ // list all tag group handles to ally by Craft, e.g. custom database tables.
            ],
            'customLinks' => [ // add any custom links not handled automatically by Craft, e.g. linking to a matrix block id in a field. Format: "section.handle|categoryGroup.handle|userGroup.handle[:field.handle] -> section.handle|categoryGroup.handle|userGroup.handle"
            ],
            'options' => [
                '

   ...
   'sections' => '*', // 

   ...
   'tags' => [], // don't 

   ...
   'customNodes' => [ // add any custom nodes not handled automatically by Craft, e.g. custom database tables.
       [
           'name' => 'User Progress - Tasks',
           'handle' => 'userProgressTasks',
           'type' => 'DATABASE TABLE',
           'fields' => [
               'task',
               'user',
               'status',
           ],
       ],
   ],
   ...

   ...
   'customLinks' => [ // add any custom links not handled automatically by Craft, e.g. linking to a matrix block id in a field. Format: "section.handle|categoryGroup.handle|userGroup.handle[:field.handle] -> section.handle|categoryGroup.handle|userGroup.handle"
       'userProgressTasks:task->taskEntries',
   ],
   ...