Skip to content

Option to not arraize some data #42

@kraftner

Description

@kraftner

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... 😉

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions