On 5/30/11 10:37 PM, Benjamin Eberlei wrote:
This is really a no go for several reasons:
1. In relational databases you have several subtypes, like Doctrine
exporting "integer", "mediumint", "bigint". More importantly the
difference between "string" and "text". Now are you going to annotate
your model properties with "@var text"? A DateTime instance can be
anything of a datetime, date or time? Which is it?
If you argue in this case just use @Column(type) to override the "@var
string" and set it to "text", then i say this is insane to have multiple
different ways of configuring something.
2. Doctrine does not necessarily name variables like their
representation in doc tools. "integer" vs "int", "boolean" vs "bool".
With the "object" type you want to typehint the "actual" type instance.
3. This is way more magical than annotations (which are already magic).
Nobody would expect @var string to have any effect on real code! This is
really documentation and the problem of docblocks being "just comments"
is solved by explicitly using something new that people may realize to
have meaning.
I totally agree with your comments here. Flow3 is a bit different as
@var annotations are used for everything in the framework. So, Flow3
developers are aware that they have a special and important meaning.
Fabien
greetings,
Benjamin
On Mon, 30 May 2011 10:37:29 +0200, Jordi Boggiano wrote:
I'm sitting in Robert Lemke's talk on FLOW3 and he mentioned that in
their Doctrine integration they automatically read the datatypes from
the @var annotations, and then it's not necessary anymore to specify it
in @Column, or @OneToOne for example the related entity is automatically
set.
Just sayin'
Cheers
--
Jordi Boggiano
@seldaek - http://nelm.io/jordi
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en