mneuhaus/TYPO3.Flow — pull request #103 by mneuhaus-bot (2014-03-26 16:20:51+00:00)
Title: [BUGFIX] Persisting of objects as serialized data not supported (Revision 5)

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.
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 hast a property wich is an object and f.e. the OneToOne
annotation is missing, the exception is thrown. But this is only thrown
if no @ORM\Column(type="object") is set.

Working Example:
/**
* @var \Acme\Foo\Bar;
* @ORM\Column(type="object")
*/
protected $fbar;

As shown in the example the doctrine behavior for objects matching and
this is invoked: \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: da0cd65acc9fcc3089a4c7d8c16bc74389992df3