function ContentEntityBase::validate

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/ContentEntityBase.php \Drupal\Core\Entity\ContentEntityBase::validate()
  2. 10 core/lib/Drupal/Core/Entity/ContentEntityBase.php \Drupal\Core\Entity\ContentEntityBase::validate()
  3. 11.x core/lib/Drupal/Core/Entity/ContentEntityBase.php \Drupal\Core\Entity\ContentEntityBase::validate()
1 call to ContentEntityBase::validate()
Media::validate in core/modules/media/src/Entity/Media.php
1 method overrides ContentEntityBase::validate()
Media::validate in core/modules/media/src/Entity/Media.php

File

core/lib/Drupal/Core/Entity/ContentEntityBase.php, line 487

Class

ContentEntityBase
Implements Entity Field API specific enhancements to the Entity class.

Namespace

Drupal\Core\Entity

Code

public function validate() {
    $this->validated = TRUE;
    $violations = $this->getTypedData()
        ->validate();
    return new EntityConstraintViolationList($this, iterator_to_array($violations));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.