Added another front page space for Yaffs info. Added roave security for composer.
[yaffs-website] / web / core / lib / Drupal / Core / Entity / ContentEntityType.php
1 <?php
2
3 namespace Drupal\Core\Entity;
4
5 /**
6  * Provides an implementation of a content entity type and its metadata.
7  */
8 class ContentEntityType extends EntityType implements ContentEntityTypeInterface {
9
10   /**
11    * {@inheritdoc}
12    */
13   public function __construct($definition) {
14     parent::__construct($definition);
15     $this->handlers += [
16       'storage' => 'Drupal\Core\Entity\Sql\SqlContentEntityStorage',
17       'view_builder' => 'Drupal\Core\Entity\EntityViewBuilder',
18     ];
19   }
20
21   /**
22    * {@inheritdoc}
23    */
24   public function getConfigDependencyKey() {
25     return 'content';
26   }
27
28   /**
29    * {@inheritdoc}
30    *
31    * @throws \InvalidArgumentException
32    *   If the provided class does not implement
33    *   \Drupal\Core\Entity\ContentEntityStorageInterface.
34    *
35    * @see \Drupal\Core\Entity\ContentEntityStorageInterface
36    */
37   protected function checkStorageClass($class) {
38     $required_interface = ContentEntityStorageInterface::class;
39     if (!is_subclass_of($class, $required_interface)) {
40       throw new \InvalidArgumentException("$class does not implement $required_interface");
41     }
42   }
43
44 }