Commit 6dc860db authored by alexpott's avatar alexpott
Browse files

Issue #2406113 by fago: Clarify how ContentEntityForm::validate() should be overridden

parent 3e43de76
......@@ -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
public function validate(array $form, FormStateInterface $form_state) {
$entity = $this->buildEntity($form, $form_state);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment