Model objects with space in the name
|Priority:||Should have||Due date:|
When a model object has one or more space in its name, it is processed as it.
My proposal would be to replace each space by an underscore in Tx_ExtbaseKickstarter_Domain_Model_DomainObject::setName()
and add a call to Tx_Extbase_Utility_Extension::convertLowerUnderscoreToUpperCamelCase() in Tx_ExtbaseKickstarter_Service_CodeGenerator in the generation of the domain model file.
|related to Extension Builder - Bug #5694: Invalid classnames in Domain model||Resolved||2009-12-09|
Updated by Georg Grossberger about 3 years ago
I can confirm this. Tried to create a model, name it "Index Entry" and the generated file was "Domain/Model/Index Entry.php", containing a class named "...Domain_Model_Index Entry".
Of course, the same applies to class members as well.
Since the given name is used as the BE label, it should be possible to write it with white spaces, which are removed in the generated code. I know those labels should be written in CamelCase and the humanize view helper puts in some spaces, but that's not very intuitive.
One solution would be to check in the setName properties in Tx_ExtbaseKickstarter_Domain_Model_DomainObject and Tx_ExtbaseKickstarter_Domain_Model_AbstractProperty for white spaces and remove them accordingly
eg: make "My important Class member", "MyImportantClassMember" and the humanize view helper takes care of the rest.