PHP code example of davidkmenta / doctrine-simple-array-types

1. Go to this page and download the library: Download davidkmenta/doctrine-simple-array-types 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/ */

    

davidkmenta / doctrine-simple-array-types example snippets

 php


\Doctrine\DBAL\Types\Type::addType('simple_string_array', 'DavidKmenta\DoctrineSimpleArrayTypes\SimpleStringArrayType');
$entityManager->getConnection()->getDatabasePlatform()->registerDoctrineTypeMapping('simple_string_array', 'simple_string_array');

\Doctrine\DBAL\Types\Type::addType('simple_integer_array', 'DavidKmenta\DoctrineSimpleArrayTypes\SimpleIntegerArrayType');
$entityManager->getConnection()->getDatabasePlatform()->registerDoctrineTypeMapping('simple_integer_array', 'simple_integer_array');

\Doctrine\DBAL\Types\Type::addType('simple_float_array', 'DavidKmenta\DoctrineSimpleArrayTypes\SimpleFloatArrayType');
$entityManager->getConnection()->getDatabasePlatform()->registerDoctrineTypeMapping('simple_float_array', 'simple_float_array');
yaml
doctrine:
    dbal:
        types:
            simple_string_array: 'DavidKmenta\DoctrineSimpleArrayTypes\SimpleStringArrayType'
            simple_integer_array: 'DavidKmenta\DoctrineSimpleArrayTypes\SimpleIntegerArrayType'
            simple_float_array: 'DavidKmenta\DoctrineSimpleArrayTypes\SimpleFloatArrayType'