Using FOSUserBundle, Symfony2 and Doctrine, I am trying to introduce a new field in the user entity.
I haven't had problems so far customizing the user Entity to add field of "normal" types, such as, string, boolean, etc...
But now I want to add a field of type "Array", just I have made in other entities.
This is the code I am introducing in the User entity:
/**
* @var array $archivedPackages
*
* @ORM\Column(name="archivedPackages", type="array")
*/
private $archivedPackages;
But as soon as I reload my page once I have re-generated the entities (doctrine:generate:entities
), I get the following error:
ConversionException: Could not convert database value "" to Doctrine Type array
The stack:
in /Users/pgbonino/Sites/Symfony/vendor/doctrine-dbal/lib/Doctrine/DBAL/Types/ConversionException.php line 46
at ConversionException::conversionFailed() in /Users/pgbonino/Sites/Symfony/vendor/doctrine-dbal/lib/Doctrine/DBAL/Types/ArrayType.php line 48
at ArrayType->convertToPHPValue() in /Users/pgbonino/Sites/Symfony/vendor/doctrine/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php line 85
at SimpleObjectHydrator->_hydrateRow() in /Users/pgbonino/Sites/Symfony/vendor/doctrine/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php line 43
at SimpleObjectHydrator->_hydrateAll() in /Users/pgbonino/Sites/Symfony/vendor/doctrine/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php line 99
at AbstractHydrator->hydrateAll() in /Users/pgbonino/Sites/Symfony/vendor/doctrine/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php line 582
at BasicEntityPersister->load() in /Users/pgbonino/Sites/Symfony/vendor/doctrine/lib/Doctrine/ORM/EntityRepository.php line 181
at EntityRepository->findOneBy() in /Users/pgbonino/Sites/Symfony/vendor/bundles/FOS/UserBundle/Entity/UserManager.php line 69
at UserManager->findUserBy() in /Users/pgbonino/Sites/Symfony/vendor/bundles/FOS/UserBundle/Model/UserManager.php line 79
at UserManager->findUserByUsername() in /Users/pgbonino/Sites/Symfony/vendor/bundles/FOS/UserBundle/Model/UserManager.php line 141
at UserManager->loadUserByUsername() in /Users/pgbonino/Sites/Symfony/vendor/bundles/FOS/UserBundle/Model/UserManager.php line 127