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

Convert all ArrayObjects to native arrays [Trying to solve broken down migrations] #36

Merged
merged 1 commit into from
Nov 16, 2016
Merged

Convert all ArrayObjects to native arrays [Trying to solve broken down migrations] #36

merged 1 commit into from
Nov 16, 2016

Conversation

thomseddon
Copy link
Contributor

@thomseddon thomseddon commented Aug 19, 2016

Hey,

Migration resets/rollbacks don't seem to work with this library, the suspect parts in Larvel are Migrator->rollback and Migrator->runDown

As you can see, rollback casts each migration to an object before passing to runDown, which then tries to access the object property. As php-rql returns ArrayObject's, this access fails.

This change is a bit hacky but converts ArrayObjects to native arrays!

Questions:

  • Has anybody else found down/rollback migrations to be broken?
  • Any idea why ArrayObject is used? (I have an issue open with php-rql)
  • Is there a better approach?

Thanks!

@thomseddon
Copy link
Contributor Author

Following up on this, the laravel-mongodb project specifically requests that documents be returned as native arrays here, so by returning an ArrayObject this project does have a different behaviour.

I've open danielmewes/php-rql#137 to see if php-rql fancy supporting something like this, in the interim this PR does fix the behaviour.

@duxet duxet merged commit a6e70b7 into duxet:master Nov 16, 2016
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.

2 participants