We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When exporting a bean currently it will export different information based on if the bean has been stored or not.
Firstly, it's understood that the id column of a bean that has not yet been stored will be zero. This issue is not about that.
id
R::setup("sqlite:./test.db"); $author = R::dispense('author'); $author->name = 'Some Guy'; $book = R::dispense('book'); $book->title = 'Every Book Makes Someone Mad'; $book->author = $author; // R::store($book); var_dump($book->export());
The above code (without storing the bean) will output:
array(3) { ["id"]=> int(0) ["title"]=> string(28) "Every Book Makes Someone Mad" ["author"]=> array(2) { ["id"]=> int(0) ["name"]=> string(8) "Some Guy" } }
However, if you uncomment that line and actually store the bean, you will get a different output:
array(3) { ["id"]=> string(1) "1" ["title"]=> string(28) "Every Book Makes Someone Mad" ["author_id"]=> string(1) "1" }
Lastly, if we change the export() invocation to set $onlyMe = true and still export an unstored bean, like this:
export()
$onlyMe = true
R::setup("sqlite:./test.db"); $author = R::dispense('author'); $author->name = 'Some Guy'; $book = R::dispense('book'); $book->title = 'Every Book Makes Someone Mad'; $book->author = $author; // R::store($book); var_dump($book->export(false, false, true));
We still get an export that contains the author bean, despite the $onlyMe argument somewhat indicating this is not expected behavior.
author
$onlyMe
Let me know if I can be of any help!
The text was updated successfully, but these errors were encountered:
#739 (comment)
Sorry, something went wrong.
No branches or pull requests
When exporting a bean currently it will export different information based on if the bean has been stored or not.
Firstly, it's understood that the
id
column of a bean that has not yet been stored will be zero. This issue is not about that.The above code (without storing the bean) will output:
However, if you uncomment that line and actually store the bean, you will get a different output:
Lastly, if we change the
export()
invocation to set$onlyMe = true
and still export an unstored bean, like this:We still get an export that contains the
author
bean, despite the$onlyMe
argument somewhat indicating this is not expected behavior.Let me know if I can be of any help!
The text was updated successfully, but these errors were encountered: