Closed bjornpost closed 10 years ago
@lox Are you able to reproduce the issue I'm seeing with this testcase?
ping @lox
Thanks! :+1:
Hmm, @lox, can you reopen this? Seems like the issue isn't fixed:
Questionnaire -- belongsTo (projectID, id) --> Project
Pheasant checks for Model\Project[id=x]
in the cache. The key (id) is correct, but the value it checks for not. x
is not the foreign value, but the local value.
For HasOne
relationships the symptoms are exactly the other way around. The value it checks for is correct, but the key is not.
I don't know why, but I can't seem to re-open this. Strange.
See https://github.com/lox/pheasant/issues/109 instead. /cc @lox @bjornpost
I couldn't reproduce with the Hero/SecretIdentity example DomainObjects, so I've simplified the models which trigger the issue in our project and included them here (PHP 5.4 only, so this testcase might fail on 5.3).
Differences between Hero/SecretIdentity and Veldwerkdag/Project are the definition of the primary key (Sequence vs. Integer) and in the belongsTo relationship we define both local and foreign keys.
Please
var_dump($schema->hash($object, array($this->local)))
inRelationships/BelongsTo.php
to see the issue. (Not sure how I could let the test fail on this)