Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Allowing options to be given with resource[0].id syntax#10199

Merged
lchrusciel merged 2 commits into
Sylius:masterfrom
Roshyo:patch-5
Apr 19, 2019
Merged

Allowing options to be given with resource[0].id syntax#10199
lchrusciel merged 2 commits into
Sylius:masterfrom
Roshyo:patch-5

Conversation

@Roshyo
Copy link
Copy Markdown
Contributor

@Roshyo Roshyo commented Feb 26, 2019

Q A
Branch? 1.3
Bug fix? no
New feature? yes
BC breaks? potentially ?
Deprecations? no
Related tickets
License MIT

When customizing grids quite a lot, we might get a queryBuilder returning an array of array instead of an array of entities. this array is built like this :

$result = [
    0 => new Resource(),
    'custom_value' => 8,
    'other_custom_value' => 'aaa',
]

And for this reason, it might be usefull to allow this kind of option parsing.

When customizing grids quite a lot, we might get a queryBuilder returning an array of array instead of an array of entities. this array is built like this : 
```php
$result = [
    0 => new Resource(),
    'custom_value' => 8,
    'other_custom_value' => 'aaa',
]
```

And for this reason, it might be usefull to allow this kind of option parsing.
@Roshyo Roshyo requested a review from a team as a code owner February 26, 2019 12:28
@pamil pamil added the Feature New feature proposals. label Mar 11, 2019
Copy link
Copy Markdown
Contributor

@pamil pamil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add some tests for it?

@Zales0123
Copy link
Copy Markdown
Contributor

ping @Roshyo :)

@Roshyo
Copy link
Copy Markdown
Contributor Author

Roshyo commented Apr 3, 2019

Oh yeah indeed. I totally forgot this.

What sort of tests should I add ?
I'm afraid Behat will be hard to cover this. It would require creating a whole new grid, with a whole new page and a custom queryBuilder.

@Zales0123
Copy link
Copy Markdown
Contributor

Some unit test in OptionsParserSpec at least, we can optionally think about something more sophisticated later :)

@Roshyo
Copy link
Copy Markdown
Contributor Author

Roshyo commented Apr 7, 2019

Here we are.

@Roshyo
Copy link
Copy Markdown
Contributor Author

Roshyo commented Apr 15, 2019

ping @pamil @Zales0123

@lchrusciel lchrusciel merged commit 7dd67a3 into Sylius:master Apr 19, 2019
@lchrusciel
Copy link
Copy Markdown
Contributor

Thanks, Stephane! 🎉

@Roshyo Roshyo deleted the patch-5 branch April 20, 2019 11:47
@Roshyo
Copy link
Copy Markdown
Contributor Author

Roshyo commented Apr 20, 2019

Thanks to you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New feature proposals.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants