Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error undefined index "targetEntity" #1265

Merged
merged 1 commit into from
Jan 18, 2015

Conversation

andersonamuller
Copy link
Contributor

No description provided.

@doctrinebot
Copy link

Hello,

thank you for creating this pull request. I have automatically opened an issue
on our Jira Bug Tracker for you. See the issue link:

http://www.doctrine-project.org/jira/browse/DDC-3517

We use Jira to track the state of pull requests and the versions they got
included in.

@Ocramius
Copy link
Member

Dang, how did this slip in?

@andersonamuller when does this happen for you? Can we have a test case showing the notice?

@Ocramius Ocramius self-assigned this Jan 18, 2015
@andersonamuller
Copy link
Contributor Author

Sorry, I don't have much time now for a test case, try this setup:

Classes:

abstract class Animal 
{
    protected $id
}

class Cat extends Animal
{
    private $sound
}

class Sound 
{
    private $id
}

Mapping Animal:

/** @var \Doctrine\ORM\Mapping\ClassMetadata $metadata */
$builder = new \Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder($metadata);
$builder->setTable('animal');
$builder->setSingleTableInheritance();
$builder->setDiscriminatorColumn('kind', 'string', 32);
$builder->createField('id', 'binary')->isPrimaryKey()->build();

Mapping Cat:

/** @var \Doctrine\ORM\Mapping\ClassMetadata $metadata */
$builder = new \Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder($metadata);
$builder->createOneToOne('sound', Sound::class)->fetchLazy()->addJoinColumn('sound_id', 'id', false)->build();

Mapping Sound:

/** @var \Doctrine\ORM\Mapping\ClassMetadata $metadata */
$builder = new \Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder($metadata);
$builder->setTable('sound');
$builder->createField('id', 'binary')->isPrimaryKey()->build();

@Ocramius
Copy link
Member

@andersonamuller I'll try integrating it with the test suite now

@Ocramius Ocramius merged commit d480938 into doctrine:master Jan 18, 2015
Ocramius added a commit that referenced this pull request Jan 18, 2015
… there is a one-to-one association in a subclass
Ocramius added a commit that referenced this pull request Jan 18, 2015
Ocramius added a commit that referenced this pull request Jan 18, 2015
Ocramius added a commit that referenced this pull request Jan 18, 2015
…es-fix' into hotfix/#1265-sti-persister-one-to-one-association-notices
@Ocramius
Copy link
Member

I integrated tests and merged everything in master at d8d4ec6

Thanks @andersonamuller!

@andersonamuller
Copy link
Contributor Author

@Ocramius
My pleasure, thank you for your hard work. Looking forward for the release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants