NoCorrespondingEntityClassException.php

Same filename in other branches
  1. 9 core/lib/Drupal/Core/Entity/Exception/NoCorrespondingEntityClassException.php
  2. 8.9.x core/lib/Drupal/Core/Entity/Exception/NoCorrespondingEntityClassException.php
  3. 10 core/lib/Drupal/Core/Entity/Exception/NoCorrespondingEntityClassException.php

Namespace

Drupal\Core\Entity\Exception

File

core/lib/Drupal/Core/Entity/Exception/NoCorrespondingEntityClassException.php

View source
<?php

namespace Drupal\Core\Entity\Exception;


/**
 * Exception thrown if an entity type is not represented by a class.
 *
 * This might occur by calling a static method on an abstract class.
 *
 * @see \Drupal\Core\Entity\EntityTypeRepositoryInterface::getEntityTypeFromClass()
 */
class NoCorrespondingEntityClassException extends \Exception {
    
    /**
     * Constructs a NoCorrespondingEntityClassException.
     *
     * @param string $class
     *   The class which does not correspond to an entity type.
     */
    public function __construct($class) {
        $message = sprintf('The %s class does not correspond to an entity type.', $class);
        parent::__construct($message);
    }

}

Classes

Title Deprecated Summary
NoCorrespondingEntityClassException Exception thrown if an entity type is not represented by a class.

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