PHP code example of coolms / field-doctrine

1. Go to this page and download the library: Download coolms/field-doctrine 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/ */

    

coolms / field-doctrine example snippets


use CoolMS\Field\Entity\Definition;
use CoolMS\Field\Entity\DefinitionInterface;

$container->prependExtensionConfig('doctrine', [
    'orm' => [
        'resolve_target_entities' => [
            DefinitionInterface::class => Definition::class,
        ],
        'entity_managers' => [
            'central' => [
                'mappings' => [
                    'FieldBundle' => [
                        'is_bundle' => false,
                        'type' => 'xml',
                        'dir' => '%kernel.project_dir%/vendor/coolms/field-doctrine/src/mapping',
                        'prefix' => 'CoolMS\Field\Entity',
                        'alias' => 'Field',
                    ],
                ],
            ],
        ],
    ],
]);