Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
6dc860db
Commit
6dc860db
authored
Jan 18, 2015
by
alexpott
Browse files
Issue
#2406113
by fago: Clarify how ContentEntityForm::validate() should be overridden
parent
3e43de76
Changes
1
Hide whitespace changes
Inline
Side-by-side
core/lib/Drupal/Core/Entity/ContentEntityForm.php
View file @
6dc860db
...
...
@@ -58,6 +58,15 @@ public function form(array $form, FormStateInterface $form_state) {
/**
* {@inheritdoc}
*
* Note that extending classes should not override this method to add entity
* validation logic, but define further validation constraints using the
* entity validation API and/or provide a new validation constraint if
* necessary. This is the only way to ensure that the validation logic
* is correctly applied independently of form submissions; e.g., for REST
* requests.
* For more information about entity validation, see
* https://www.drupal.org/node/2015613.
*/
public
function
validate
(
array
$form
,
FormStateInterface
$form_state
)
{
$entity
=
$this
->
buildEntity
(
$form
,
$form_state
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment