Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix error undefined index "targetEntity"#1265

Merged
Ocramius merged 1 commit into
doctrine:masterfrom
andersonamuller:patch-1
Jan 18, 2015
Merged

Fix error undefined index "targetEntity"#1265
Ocramius merged 1 commit into
doctrine:masterfrom
andersonamuller:patch-1

Conversation

@andersonamuller
Copy link
Copy Markdown
Contributor

No description provided.

@doctrinebot
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

I integrated tests and merged everything in master at d8d4ec6

Thanks @andersonamuller!

@andersonamuller
Copy link
Copy Markdown
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