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

ProxyReferenceRepository fatal error when serializing object without getId() method #93

Closed
johnkary opened this issue Mar 17, 2013 · 4 comments

Comments

@johnkary
Copy link

I'm using doctrine/data-fixtures as part of using ICBaseTestBundle. I'm using ICBaseTestBundle's getFixtureList() functionality to load some fixtures prior to executing a test case.

The entity whose fixtures I'm loading does not have a getId() method because my primary key field is mapped to another property (e.g. private $code; instead of private $id;), so it doesn't make sense to expose a getId() method because that means nothing to my entity.

Could ProxyReferenceRepository use another way to find the primary key(s) used by the given entity (maybe via UOW) instead of calling getId()?

On a slightly related note, I was going to try writing a failing test for this but ran into the test suite exhausting available memory above memory_limit=2G on test Doctrine\Tests\Common\DataFixtures\DependentFixtureTest::test_orderFixturesByDependencies_circularReferencesMakeMethodThrowCircularReferenceException using PHPUnit 3.7.9 installed via PEAR w/o xDebug. PHPUnit 3.7.14 installed via composer had issues with using Composer dev-master's autoloader.

Issue exists as of eef10f6
Issue appears to occur here:

$simpleReferences[$name] = array($className, $reference->getId());

@ddeboer
Copy link

ddeboer commented Oct 10, 2013

I'm having the same problem. Any progress on this?

@guilhermeblanco
Copy link
Member

Will look into this one tomorrow. =)

@guilhermeblanco
Copy link
Member

Fixed as of 8ffac1c

@johnkary
Copy link
Author

Very nice, thanks Guilherme!

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

No branches or pull requests

3 participants