Created
September 29, 2014 02:19
-
-
Save anonymous/96d9acfec99f2c09da10 to your computer and use it in GitHub Desktop.
One to One Relationship embed form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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('user', new UserFieldsType()) | |
; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Acme\DemoBundle\Entity\Users: | |
type: entity | |
table: users | |
uniqueConstraints: | |
user_id_UNIQUE: | |
columns: | |
- user_id | |
id: | |
user_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: | |
user: | |
targetEntity: UserFields | |
cascade: | |
- all | |
mappedBy: null | |
inversedBy: null | |
joinColumns: | |
user_id: | |
referencedColumnName: user_id | |
orphanRemoval: false | |
lifecycleCallbacks: { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Acme\DemoBundle\Entity\UserFields: | |
type: entity | |
table: user_fields | |
uniqueConstraints: | |
user_id_UNIQUE: | |
columns: | |
- user_id | |
id: | |
id: | |
type: integer | |
nullable: false | |
unsigned: false | |
comment: '' | |
id: true | |
generator: | |
strategy: IDENTITY | |
fields: | |
userId: | |
type: integer | |
nullable: true | |
unsigned: false | |
comment: '' | |
column: user_id | |
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