-
Notifications
You must be signed in to change notification settings - Fork 44
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
New Feature/Enhancement requests/ideas #18
Comments
Hey @vienthuong. It would be nice to have something like $product = new ProductEntity();
$product->active = true;
$productRepository->create($product->toArray(), $context); ... which only should return populated fields. I've tried this by using the |
Hi @solverat $productRepository->create([
'active' => true, // or $product->active
], $context); Or $productRepository->create(array_filter($product->jsonSerialize()), $context); Will it work in your case? Filtering every null property out seems not a correct approach. For example when you want to set a property back to null then you need to define that property as null. But feel free to create a PR or just a draft solution then I will take a look if it could be a good idea to add the method, thanks |
Maybe another one :): Uploading asset binaries via repository (?) would be nice. In some cases, URLs are not reachable from outside. |
Hi @vienthuong, On my team we use psalm and sometimes it gets a little bit frustrating that all of the properties in entities are nullable/set to null by default. This either generates a lot of null-checking or disabling null checks in psalm altogether. I reckon that "fixing" or adjusting this wouldn't be a breaking change, right? It's a slight annoyance, especially when you don't normally expect a null value in Shopware: // CurrencyEntity/SDK:
public ?string $symbol = null;
// CurrencyEntity/Shopware:
/**
* @var string
*/
protected $symbol; |
Hi @jakub-groncki https://github.com/vienthuong/shopware-php-sdk/blob/master/script/src/CodeGenerator.php I'd recommend ignore these psalm rule using some regex pattern if possible. Or feel free to create a MR to update the CodeGenerator if you find it useful :) |
Hi @vienthuong, I was thinking about the same thing when it comes to the code generator. I think I'm going to fork this repo and try it out. We consider psalm rules very ad hoc in this context so having a solid nullability correspondence with the actual Shopware API would be great. I think I might give it a go :) |
We've released the SDK for a while and as Shopware core is growing really fast as well, the SDK might get a bit out of date APIs, or lack features, using deprecated APIs, etc...
So with this thread, I want to gather the ideas/solutions from the community or even improve PR to make the SDK better. Any comments/suggestions are welcomed and highly appreciated 🤝
For bug issues, please create a new one so I can keep the track of them :)
The text was updated successfully, but these errors were encountered: