Skip to content

Conversation

dunglas
Copy link
Member

@dunglas dunglas commented Jan 18, 2017

Closes #152

*
* @return string[]
*/
public static function validationGroups(self $book)
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally this should belong in another class, no?

Copy link
Member Author

Choose a reason for hiding this comment

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

It depends of the use case, if it's only some lines of code I think it's ok to put it in the entity.
But the goal here is just to give a short example, introducing a new class is overkill for a doc.

@aledeg
Copy link
Contributor

aledeg commented Jan 18, 2017

Silly question.
Is it possible to use a service instead of a class? If so, how can I do it?

Disclaimer. I haven't try. I was just wondering...

@teohhanhui
Copy link
Contributor

We can make it work with a service with some extra glue (in the Symfony Bridge).

@dunglas
Copy link
Member Author

dunglas commented Jan 19, 2017

Yes but it's currently not supported.

@dunglas dunglas merged commit 182c64f into 2.0 Jan 24, 2017
@dunglas dunglas deleted the dynamic-validation branch January 24, 2017 21:17
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

Successfully merging this pull request may close these issues.

4 participants