fluent icon indicating copy to clipboard operation
fluent copied to clipboard

The oneToOne relation not exist joinColumn method

Open saintho opened this issue 8 years ago • 6 comments

public function map(Fluent $builder){ $builder->entity()->setRepositoryClass(DiscussionDoctrineRepository::class); $builder->table('my_discussion'); $builder->increments('id'); $builder->string('title'); $builder->string('content'); $builder->string('cover'); $builder->string('createTime'); $builder->string('startTime'); $builder->string('endTime'); $builder->string('status'); $builder->string('hot')->columnName('hot_score'); $builder->oneToOne(User::class, 'user')->joinColumn('uid', 'uid'); }

above joinColumn not exist joinColumn method, is bug?

saintho avatar Aug 31 '17 15:08 saintho

It may be missing, yes.

guiwoda avatar Aug 31 '17 18:08 guiwoda

PR is more than welcome

patrickbrouwers avatar Aug 31 '17 18:08 patrickbrouwers

Have you planned to repair it?

saintho avatar Sep 01 '17 02:09 saintho

Not the answers I was expecting on "PR is more than welcome" ;) It will be fixed sometime, but currently don't have time for it.

patrickbrouwers avatar Sep 01 '17 07:09 patrickbrouwers

@saintho All associations have a getAssociation() method that will expose Doctrine's AssociationBuilder object. You can always work around Fluent and go directly to Doctrine's php mapper, so this is not something to fix, rather a missing feature.

Also, this is an open source effort. We'll gladly receive contributions and completely ignore "fix demands". Please be the former and not the latter ;-)

guiwoda avatar Sep 01 '17 14:09 guiwoda

Okay, I will commit PR in this weekend @guiwoda

saintho avatar Sep 04 '17 14:09 saintho