Symfony set Field name when schema fields have spaces
We have a Excel spreadsheet with data to import into MySQL from a client. Some of the column names have spaces in them, so w开发者_运维技巧hen we build the schema with the data-dump function it adds spaces into the field names; thus the BaseModels have it too.
'Client Field': { type: string, peerName: client_field }
Wondering if there is an attribute to add to the field in the schema to add spaces to the field names? For example there is peerName and phpName: is there an attribute to remove the spaces from fields?
Not 100% sure what you mean (and having spaces in the field name is a bad design), but this might be what you want:
class YourModel extends BaseYourModel
{
public function setClientField($value)
{
return parent::_set('Client Field', $value);
}
public function getClientField()
{
return parent::_get('Client Field');
}
}
精彩评论