-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[WIP] Adding a resource form type #1772
Conversation
$options['validation_groups'] = $this->validationGroups; | ||
} | ||
|
||
$resolver->setDefaults($options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO good enough would be:
$resolver->setDefaults(array(
'data_class' => $this->dataClass,
'validation_groups' => $this->validationGroups,
));
Cause anyway you have validation done on resolver (if not we should add it).
If we go this way, that class should be in |
@stloyd For sure! I don't know what I did... SettingBundle.... |
@stloyd, Done. @pjedrzejewski what do you think ? |
protected $dataClass = null; | ||
|
||
/** | ||
* @var array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
string[]
Looks good, I guess you should adjust forms in repository to reduce the duplication ;) |
@stloyd Every forms should be updated. @pjedrzejewski this one? or I open another one? |
Sounds good to me. I am fine with adjusting them in this PR. I will make sure to merge it quick and avoid conflicts. |
@pjedrzejewski I will updated ASAP (I am in holidays for a week) |
@pjedrzejewski, @stloyd, sometime form only need data class, sometime only they need validation groups or they need both... Setter could be better but the service definitions should be rewritten... Both solutions are huge... I just update form which used data class or the both? Any opinion on this ? |
Some form type constructors change, I need to manage it. |
dfb5e80
to
861d053
Compare
protected $actionRegistry; | ||
|
||
public function __construct($dataClass, array $validationGroups, ServiceRegistryInterface $actionRegistry) | ||
{ | ||
$this->dataClass = $dataClass; | ||
$this->validationGroups = $validationGroups; | ||
parent::__construct($dataClass, $validationGroups, $actionRegistry); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$actionRegistry
must be removed here.
861d053
to
ed7780b
Compare
@stloyd Fixed :) |
@pjedrzejewski what do you about it ? |
[WIP] Adding a resource form type
@Arn0d I love the diff stats, it is a good refactoring. ;) Thank you very much! 👍 |
I already submit a PR like that but it was a little bit different. I use resource bundle for custom development and I create this form all the time, it is really annoying! If you are agree with this I can update the Sylius's form in a other PR.