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

Option to not arraize some data #42

Open
kraftner opened this issue Sep 30, 2016 · 1 comment
Open

Option to not arraize some data #42

kraftner opened this issue Sep 30, 2016 · 1 comment

Comments

@kraftner
Copy link
Contributor

Would you consider adding the option to keep some objects as they are? Because when having a complex nested array of data where everything except some certain type of data needs to be arraized this would be really handy.

My first idea would be to just use the existing transformer parameter. If the value is false just skip the arraization and keep the object:

$arraized = $Foil\arraize($products, true, ['My\App\Product'=> false]);

I wouldn't be surprised though if you said wontfix as this breaks the basic assumption that

whatever data you pass to the function at the end of the process, you get an array that contains no objects

Just asking... 😉

@brad-jones
Copy link
Contributor

I also just found a need for this.

Even with autoescape turned off it still seems as though arraize is mangling my objects.

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

2 participants