mneuhaus/TYPO3.Flow — pull request #129 by mneuhaus-bot (2014-10-04 13:36:50+00:00)
Title: [BUGFIX] Persisting of objects as serialized data not supported (Revision 9)

The Reflection does not add properties to metadata information if
they are not tagged with entity/value object. This makes it f.e.
impossible to store an object as serialized object. Before this patch
any Object (excepted some whitelisted) need at least OneToOne annotation.
To be able to store f.e. UserSettings/BasketItems/Sessions or DTO Objects,
the doctrine Annotation @ORM\Column(type="object") needs to be supported.
This is supported with this patch.

The whitelist from ReflectionService was removed. So any kind of
Object is allowed.

ClassSchema does not get informations about @Flow\Transient properties.
This is also done for @Flow\Inject annotated properties.
Otherwise the Persistence tries to store f.e. an injected ObjectManager.
Maybe this can removed if CGL says:
"Any @Flow\Inject on Entity/ValueObjects also needs a @Flow\Transient"

If an Object has a property which is an object and f.e. the OneToOne
annotation is missing, an exception is thrown as before.
But this is only thrown if no @ORM\Column(type="object") is set (New behavior).

Working Example::

/**
* @var \Acme\Foo\Bar;
* @ORM\Column(type="object")
*/
protected $bar;

In the example above the doctrine behavior for object types matches and invokes
``\Doctrine\DBAL\Types\ObjectType``

Also added some tests for other extended types supported by Doctrine:

* \Doctrine\DBAL\Types\Type::SIMPLE_ARRAY;
* \Doctrine\DBAL\Types\Type::JSON_ARRAY;
* \Doctrine\DBAL\Types\Type::DATETIME;
* \Doctrine\DBAL\Types\Type::DATETIMETZ;
* \Doctrine\DBAL\Types\Type::DATE;
* \Doctrine\DBAL\Types\Type::TIME;

Please note:

- DATETIMETZ seems to be buggy in Doctrine itself. Doctrine loses DateTimeZone
informations :(
- SIMPLE_ARRAY and JSON_ARRAY of Docrtine itself seems not do allow nullable :(
Maybe we need our own JSON_ARRAY, DATETIMETZ and SIMPLE_ARRAY implementations
to make them stored as NULL.

Change-Id: I6d759cffd9a46cbd789585d92324f58e66d3e9ae
Releases: master
Resolves: #54161
Revision-Id: 906e4dc1f27c5b7995ac6d6ccd632434ca41327c