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

Reset relationship columns array #43

Merged
merged 1 commit into from
Jan 4, 2017
Merged

Conversation

jakejohns
Copy link
Contributor

Reset on in AbstractRelationship::foreignSelectSimple

I was playing around (jakejohns/atlas-demo) trying to come up with a way to use events to persist related records.

Without this patch, I get the following:

PHP Fatal error:  Uncaught exception 'Atlas\Orm\Exception' with message 'Atlas\Orm\Table\Row::$ does not exist.' in vendor/atlas/orm/src/Exception.php:74
Stack trace:
#0 vendor/atlas/orm/src/Table/Row.php(339): Atlas\Orm\Exception::propertyDoesNotExist(Object(Atlas\Orm\Table\Row), '')
#1 vendor/atlas/orm/src/Table/Row.php(104): Atlas\Orm\Table\Row->assertHas('')
#2 vendor/atlas/orm/src/Relationship/AbstractRelationship.php(325): Atlas\Orm\Table\Row->__get('')
#3 vendor/atlas/orm/src/Relationship/AbstractRelationship.php(305): Atlas\Orm\Relationship\AbstractRelationship->foreignSelectSimple(Object(Atlas\Orm\Mapper\MapperSelect), Array)
#4 vendor/atlas/orm/src/Relationship/AbstractRelationship.php(279): Atlas\Orm\Relationship\AbstractRelationship->foreignSelect(Array)
#5 vendor/atlas/orm/src/Rel in vendor/atlas/orm/src/Exception.php on line 74

Although this fixes it, I can't actually explain why. I think I'm too tired to figure it out right now, so hopefully someone else can look.

Reset `on` in AbstractRelationship::foreignSelectSimple
@pmjones
Copy link
Contributor

pmjones commented Jan 4, 2017

Wow that's weird.

@pmjones pmjones merged commit 2d3e71f into atlasphp:1.x Jan 4, 2017
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.

None yet

2 participants