Skip to content

Instantly share code, notes, and snippets.

@trq
Forked from anonymous/gist:96d9acfec99f2c09da10
Last active August 29, 2015 14:07
Show Gist options
  • Save trq/f979e6844d729c509a58 to your computer and use it in GitHub Desktop.
Save trq/f979e6844d729c509a58 to your computer and use it in GitHub Desktop.
Im getting this error:
Notice: Undefined index: userId in /var/www/html/symfony2/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php line 688
class UsersType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('username')
->add('password')
->add('fields', new UserFieldsType())
;
}
Acme\DemoBundle\Entity\Users:
type: entity
table: users
id:
id:
type: integer
generator:
strategy: AUTO
fields:
username:
type: text
nullable: true
length: null
fixed: false
comment: ''
password:
type: text
nullable: true
length: null
fixed: false
comment: ''
oneToOne:
fields:
targetEntity: UserFields
cascade:
- all
joinColumns:
user_fields_id:
referencedColumnName: id
orphanRemoval: false
lifecycleCallbacks: { }
Acme\DemoBundle\Entity\UserFields:
type: entity
table: user_fields
id:
id:
type: integer
id: true
generator:
strategy: IDENTITY
fields:
age:
type: text
nullable: true
length: null
fixed: false
comment: ''
lifecycleCallbacks: { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment