[TYPO3-mvc] RFC #8050: allow object properties to be optional (ie empty)

Martin Kutschker masi-no at spam-typo3.org
Thu Jun 3 16:40:19 CEST 2010


Bugtracker reference:

http://forge.typo3.org/issues/show/8050

Problem:

When a model has validators the value may never be empty.

Solution:

Honour the @optional annotation for a property.

Note: instead of @optional the annotation could also be named @allowEmpty or @nullable.

Issues: The patch uses empty(), but this yields TRUE for "0" strings and 0 integers, which may or
may not be expected. IMHO "0" is a problem, but 0 zero not in all cases (as TYPO3 doesn't allow NULL
for integer columns anyway).

Masi


More information about the TYPO3-project-typo3v4mvc mailing list