#1504: camelCase property names break forms in sfDoctrine
----------------------------------------------+-----------------------------
Reporter: Chekote | Owner: jwage
Type: defect | Status: new
Priority: major | Milestone:
Component: Attributes | Version: 1.0
Keywords: symfony form camelCase fromArray | Has_test: 0
Mystatus: Pending Core Response | Has_patch: 0
----------------------------------------------+-----------------------------
If you use a camelCase name for a property of an entity in schema.yml, the
generated form is unable to populate the entity using the fromArray
method.
For example, create a schema.yml of the following:
{{{
Person:
columns:
firstName: string
}}}
Then run the symfony commands:
{{{
./symfony doctrine:build-all-reload frontend
./symfony doctrine:build-forms frontend
}}}
Now take a look at the following files:
{{{
/lib/form/doctrine/base/BasePersonForm
/lib/model/doctrine/generated/BasePerson
}}}
You will notice that BasePersonForm refers to the property as "firstname",
but BasePerson refers to it as "firstName". When BasePersonForm calls
BasePerson->fromArray(), and BasePerson (actually Doctrine_Record) carries
out its check:
{{{
$this->getTable()->hasField($key)
}}}
It will return false, and the data will not be populated.
--
Ticket URL: <http://trac.doctrine-project.org/ticket/1504>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"doctrine-svn" 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.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---