b2c1f5d20edae0e66f95426644d2d5bcd248d1ae
[yaffs-website] / web / core / lib / Drupal / Core / Entity / EntityTypeInterface.php
1 <?php
2
3 namespace Drupal\Core\Entity;
4
5 use Drupal\Component\Plugin\Definition\PluginDefinitionInterface;
6
7 /**
8  * Provides an interface for an entity type and its metadata.
9  *
10  * Entity type classes can provide docblock annotations. The entity type manager
11  * will use these annotations to populate the entity type object with
12  * properties.
13  *
14  * Additional properties can be defined by module implementations of
15  * hook_entity_type_build(). Existing data can be altered in implementations of
16  * hook_entity_type_alter(), which can also be used to fill in defaults.
17  * Module-specific properties should be documented in the hook implementations
18  * defining them.
19  *
20  * @see \Drupal\Core\Entity\EntityTypeManagerInterface
21  * @see hook_entity_type_build()
22  * @see hook_entity_type_alter()
23  */
24 interface EntityTypeInterface extends PluginDefinitionInterface {
25
26   /**
27    * The maximum length of ID, in characters.
28    */
29   const ID_MAX_LENGTH = 32;
30
31   /**
32    * The maximum length of bundle name, in characters.
33    */
34   const BUNDLE_MAX_LENGTH = 32;
35
36   /**
37    * Gets any arbitrary property.
38    *
39    * @param string $property
40    *   The property to retrieve.
41    *
42    * @return mixed
43    *   The value for that property, or NULL if the property does not exist.
44    */
45   public function get($property);
46
47   /**
48    * Sets a value to an arbitrary property.
49    *
50    * @param string $property
51    *   The property to use for the value.
52    * @param mixed $value
53    *   The value to set.
54    *
55    * @return $this
56    */
57   public function set($property, $value);
58
59   /**
60    * Gets the name of the original entity type class.
61    *
62    * In case the class name was changed with setClass(), this will return
63    * the initial value. Useful when trying to identify the entity type ID based
64    * on the class.
65    *
66    * @return string
67    *   The name of the original entity type class.
68    */
69   public function getOriginalClass();
70
71   /**
72    * Gets an array of entity keys.
73    *
74    * @return array
75    *   An array describing how the Field API can extract certain information
76    *   from objects of this entity type:
77    *   - id: The name of the property that contains the primary ID of the
78    *     entity. Every entity object passed to the Field API must have this
79    *     property and its value must be numeric.
80    *   - revision: (optional) The name of the property that contains the
81    *     revision ID of the entity. The Field API assumes that all revision IDs
82    *     are unique across all entities of a type. If this entry is omitted
83    *     the entities of this type are not revisionable.
84    *   - bundle: (optional) The name of the property that contains the bundle
85    *     name for the entity. The bundle name defines which set of fields are
86    *     attached to the entity (e.g. what nodes call "content type"). This
87    *     entry can be omitted if this entity type exposes a single bundle (such
88    *     that all entities have the same collection of fields). The name of this
89    *     single bundle will be the same as the entity type.
90    *   - label: (optional) The name of the property that contains the entity
91    *     label. For example, if the entity's label is located in
92    *     $entity->subject, then 'subject' should be specified here. If complex
93    *     logic is required to build the label,
94    *     \Drupal\Core\Entity\EntityInterface::label() should be used.
95    *   - langcode: (optional) The name of the property that contains the
96    *     language code. For instance, if the entity's language is located in
97    *     $entity->langcode, then 'langcode' should be specified here.
98    *   - uuid: (optional) The name of the property that contains the universally
99    *     unique identifier of the entity, which is used to distinctly identify
100    *     an entity across different systems.
101    */
102   public function getKeys();
103
104   /**
105    * Gets a specific entity key.
106    *
107    * @param string $key
108    *   The name of the entity key to return.
109    *
110    * @return string|bool
111    *   The entity key, or FALSE if it does not exist.
112    *
113    * @see self::getKeys()
114    */
115   public function getKey($key);
116
117   /**
118    * Indicates if a given entity key exists.
119    *
120    * @param string $key
121    *   The name of the entity key to check.
122    *
123    * @return bool
124    *   TRUE if a given entity key exists, FALSE otherwise.
125    */
126   public function hasKey($key);
127
128   /**
129    * Indicates whether entities should be statically cached.
130    *
131    * @return bool
132    *   TRUE if static caching should be used; FALSE otherwise.
133    */
134   public function isStaticallyCacheable();
135
136   /**
137    * Indicates whether the rendered output of entities should be cached.
138    *
139    * @return bool
140    */
141   public function isRenderCacheable();
142
143   /**
144    * Indicates if the persistent cache of field data should be used.
145    *
146    * @todo Used by ContentEntityStorageBase only.
147    *
148    * The persistent cache should usually only be disabled if a higher level
149    * persistent cache is available for the entity type.
150    *
151    * @return bool
152    */
153   public function isPersistentlyCacheable();
154
155   /**
156    * Determines if there is a handler for a given type.
157    *
158    * @param string $handler_type
159    *   The type of handler to check.
160    * @param bool $nested
161    *   (optional) If this handler has a nested definition. Defaults to FALSE.
162    *
163    * @return bool
164    *   TRUE if a handler of this type exists, FALSE otherwise.
165    */
166   public function hasHandlerClass($handler_type, $nested = FALSE);
167
168   /**
169    * @param string $handler_type
170    *   The handler type to get.
171    *
172    * @return array|string|null
173    *   The handlers for a given type, or NULL if none exist.
174    */
175   public function getHandlerClass($handler_type);
176
177   /**
178    * Gets an array of handlers.
179    *
180    * @return array
181    *   An associative array where the keys are the names of different handler
182    *   types (listed below) and the values are the names of the classes that
183    *   implement that handler:
184    *   - storage: The name of the class used to load the objects. The class must
185    *     implement \Drupal\Core\Entity\EntityStorageInterface.
186    *   - form: An associative array where the keys are the names of the
187    *     different form operations (such as 'create', 'edit', or 'delete') and
188    *     the values are the names of the handler classes for those
189    *     operations. The name of the operation is passed also to the form
190    *     handler's constructor, so that one class can be used for multiple
191    *     entity forms when the forms are similar. The classes must implement
192    *     \Drupal\Core\Entity\EntityFormInterface.
193    *   - list: The name of the class that provides listings of the entities. The
194    *     class must implement \Drupal\Core\Entity\EntityListBuilderInterface.
195    *   - render: The name of the class that is used to render the entities. The
196    *     class must implement \Drupal\Core\Entity\EntityViewBuilderInterface.
197    *   - access: The name of the class that is used for access checks. The class
198    *     must implement \Drupal\Core\Entity\EntityAccessControlHandlerInterface.
199    *     Defaults to \Drupal\Core\Entity\EntityAccessControlHandler.
200    *   - route_provider: (optional) A list of class names, keyed by a group
201    *     string, which will be used to define routes related to this entity
202    *     type. These classes must implement
203    *     \Drupal\Core\Entity\Routing\EntityRouteProviderInterface.
204    */
205   public function getHandlerClasses();
206
207   /**
208    * Gets the storage class.
209    *
210    * @return string
211    *   The class for this entity type's storage.
212    */
213   public function getStorageClass();
214
215   /**
216    * Sets the storage class.
217    *
218    * @param string $class
219    *   The class for this entity type's storage.
220    *
221    * @return $this
222    */
223   public function setStorageClass($class);
224
225   /**
226    * Gets the form class for a specific operation.
227    *
228    * @param string $operation
229    *   The name of the operation to use, e.g., 'default'.
230    *
231    * @return string
232    *   The class for this operation's form for this entity type.
233    *
234    * @see \Drupal\Core\Entity\EntityFormBuilderInterface
235    */
236   public function getFormClass($operation);
237
238   /**
239    * Sets a form class for a specific operation.
240    *
241    * @param string $operation
242    *   The operation to use this form class for.
243    * @param string $class
244    *   The form class implementing
245    *   \Drupal\Core\Entity\EntityFormInterface.
246    *
247    * @return $this
248    *
249    * @see \Drupal\Core\Entity\EntityFormBuilderInterface
250    */
251   public function setFormClass($operation, $class);
252
253   /**
254    * Indicates if this entity type has any forms.
255    *
256    * @return bool
257    *   TRUE if there are any forms for this entity type, FALSE otherwise.
258    */
259   public function hasFormClasses();
260
261   /**
262    * Indicates if this entity type has any route provider.
263    *
264    * @return bool
265    */
266   public function hasRouteProviders();
267
268   /**
269    * Gets all the route provide handlers.
270    *
271    * Much like forms you can define multiple route provider handlers.
272    *
273    * @return string[]
274    */
275   public function getRouteProviderClasses();
276
277   /**
278    * Gets the list class.
279    *
280    * @return string
281    *   The class for this entity type's list.
282    */
283   public function getListBuilderClass();
284
285   /**
286    * Sets the list class.
287    *
288    * @param string $class
289    *   The list class to use for the operation.
290    *
291    * @return $this
292    */
293   public function setListBuilderClass($class);
294
295   /**
296    * Indicates if this entity type has a list class.
297    *
298    * @return bool
299    *   TRUE if there is a list for this entity type, FALSE otherwise.
300    */
301   public function hasListBuilderClass();
302
303   /**
304    * Gets the view builder class.
305    *
306    * @return string
307    *   The class for this entity type's view builder.
308    */
309   public function getViewBuilderClass();
310
311   /**
312    * Gets the view builder class.
313    *
314    * @param string $class
315    *   The class for this entity type's view builder.
316    *
317    * @return $this
318    */
319   public function setViewBuilderClass($class);
320
321   /**
322    * Indicates if this entity type has a view builder.
323    *
324    * @return bool
325    *   TRUE if there is a view builder for this entity type, FALSE otherwise.
326    */
327   public function hasViewBuilderClass();
328
329   /**
330    * Gets the access control class.
331    *
332    * @return string
333    *   The class for this entity type's access control.
334    */
335   public function getAccessControlClass();
336
337   /**
338    * Sets the access control handler class.
339    *
340    * @param string $class
341    *   The class for this entity type's access control handler.
342    *
343    * @return $this
344    */
345   public function setAccessClass($class);
346
347   /**
348    * Indicates if the entity type class implements the given interface.
349    *
350    * @param string $interface
351    *   The class or interface to check.
352    *
353    * @return bool
354    *   TRUE if the entity type class implements the given interface.
355    */
356   public function entityClassImplements($interface);
357
358   /**
359    * Indicates if the entity type is a subclass of the given class or interface.
360    *
361    * @param string $class
362    *   The class or interface to check.
363    *
364    * @return bool
365    *   TRUE if the entity type is a subclass of the class or interface.
366    *
367    * @deprecated in Drupal 8.3.0 and will be removed before Drupal 9.0.0.
368    *   Use Drupal\Core\Entity\EntityTypeInterface::entityClassImplements()
369    *   instead.
370    */
371   public function isSubclassOf($class);
372
373   /**
374    * Sets the handlers for a given type.
375    *
376    * @param string $handler_type
377    *   The type of handler to set.
378    * @param array|string $value
379    *   The value for a handler type.
380    *
381    * @return $this
382    */
383   public function setHandlerClass($handler_type, $value);
384
385   /**
386    * Gets the name of the default administrative permission.
387    *
388    * The default \Drupal\Core\Entity\EntityAccessControlHandler class checks this
389    * permission for all operations in its checkAccess() method. Entities with
390    * more complex permissions can extend this class to do their own access
391    * checks.
392    *
393    * @return string|bool
394    */
395   public function getAdminPermission();
396
397   /**
398    * Gets the permission granularity level.
399    *
400    * The allowed values are respectively "entity_type" or "bundle".
401    *
402    * @return string
403    *   Whether a module exposing permissions for the current entity type
404    *   should use entity-type level granularity or bundle level granularity.
405    */
406   public function getPermissionGranularity();
407
408   /**
409    * Gets the link templates using the URI template syntax.
410    *
411    * Links are an array of standard link relations to the URI template that
412    * should be used for them. Where possible, link relationships should use
413    * established IANA relationships rather than custom relationships.
414    *
415    * Every entity type should, at minimum, define "canonical", which is the
416    * pattern for URIs to that entity. Even if the entity will have no HTML page
417    * exposed to users it should still have a canonical URI in order to be
418    * compatible with web services. Entities that will be user-editable via an
419    * HTML page must also define an "edit-form" relationship.
420    *
421    * By default, the following placeholders are supported:
422    * - [entityType]: The entity type itself will also be a valid token for the
423    *   ID of the entity. For instance, a placeholder of {node} used on the Node
424    *   class.
425    * - [bundleEntityType]: The bundle machine name itself. For instance, a
426    *   placeholder of {node_type} used on the Node class.
427    *
428    * Specific entity types may also expand upon this list by overriding the
429    * Entity::urlRouteParameters() method.
430    *
431    * @link http://www.iana.org/assignments/link-relations/link-relations.xml @endlink
432    * @link http://tools.ietf.org/html/rfc6570 @endlink
433    *
434    * @return array
435    */
436   public function getLinkTemplates();
437
438   /**
439    * Gets the link template for a given key.
440    *
441    * @param string $key
442    *   The link type.
443    *
444    * @return string|bool
445    *   The path for this link, or FALSE if it doesn't exist.
446    */
447   public function getLinkTemplate($key);
448
449   /**
450    * Indicates if a link template exists for a given key.
451    *
452    * @param string $key
453    *   The link type.
454    *
455    * @return bool
456    *   TRUE if the link template exists, FALSE otherwise.
457    */
458   public function hasLinkTemplate($key);
459
460   /**
461    * Sets a single link template.
462    *
463    * @param string $key
464    *   The name of a link.
465    * @param string $path
466    *   The route path to use for the link.
467    *
468    * @return $this
469    *
470    * @throws \InvalidArgumentException
471    *   Thrown when the path does not start with a leading slash.
472    */
473   public function setLinkTemplate($key, $path);
474
475   /**
476    * Gets the callback for the label of the entity.
477    *
478    * The function takes an entity and returns the label of the entity. Use
479    * language() on the entity to get information on the requested language. The
480    * entity label is the main string associated with an entity; for example, the
481    * title of a node or the subject of a comment. If there is an entity object
482    * property that defines the label, use the 'label' element of the
483    * 'entity_keys' return value component to provide this information. If more
484    * complex logic is needed to determine the label of an entity, you can
485    * instead specify a callback function here, which will be called to determine
486    * the entity label.
487    *
488    * @return callable|null
489    *   The callback, or NULL if none exists.
490    *
491    * @deprecated in Drupal 8.0.x-dev and will be removed before Drupal 9.0.0.
492    *   Use Drupal\Core\Entity\EntityInterface::label() for complex label
493    *   generation as needed.
494    *
495    * @see \Drupal\Core\Entity\EntityInterface::label()
496    * @see \Drupal\Core\Entity\EntityTypeInterface::setLabelCallback()
497    * @see \Drupal\Core\Entity\EntityTypeInterface::hasLabelCallback()
498    *
499    * @todo Remove usages of label_callback https://www.drupal.org/node/2450793.
500    */
501   public function getLabelCallback();
502
503   /**
504    * Sets the label callback.
505    *
506    * @param callable $callback
507    *   A callable that returns the label of the entity.
508    *
509    * @return $this
510    *
511    * @deprecated in Drupal 8.0.x-dev and will be removed before Drupal 9.0.0.
512    *   Use EntityInterface::label() for complex label generation as needed.
513    *
514    * @see \Drupal\Core\Entity\EntityInterface::label()
515    * @see \Drupal\Core\Entity\EntityTypeInterface::getLabelCallback()
516    * @see \Drupal\Core\Entity\EntityTypeInterface::hasLabelCallback()
517    */
518   public function setLabelCallback($callback);
519
520   /**
521    * Indicates if a label callback exists.
522    *
523    * @return bool
524    *
525    * @deprecated in Drupal 8.0.x-dev and will be removed before Drupal 9.0.0.
526    *   Use EntityInterface::label() for complex label generation as needed.
527    *
528    * @see \Drupal\Core\Entity\EntityInterface::label()
529    * @see \Drupal\Core\Entity\EntityTypeInterface::getLabelCallback()
530    * @see \Drupal\Core\Entity\EntityTypeInterface::setLabelCallback()
531    */
532   public function hasLabelCallback();
533
534   /**
535    * Gets the name of the entity type which provides bundles.
536    *
537    * @return string|null
538    *   The name of the entity type which provides bundles, or NULL if the entity
539    *   type does not have a bundle entity type.
540    */
541   public function getBundleEntityType();
542
543   /**
544    * Gets the entity type for which this entity provides bundles.
545    *
546    * It can be used by other modules to act accordingly; for example,
547    * the Field UI module uses it to add operation links to manage fields and
548    * displays.
549    *
550    * @return string|null
551    *   The entity type for which this entity provides bundles, or NULL if does
552    *   not provide bundles for another entity type.
553    */
554   public function getBundleOf();
555
556   /**
557    * Gets the label for the bundle.
558    *
559    * @return string
560    *   The bundle label.
561    */
562   public function getBundleLabel();
563
564   /**
565    * Gets the name of the entity's base table.
566    *
567    * @todo Used by SqlContentEntityStorage only.
568    *
569    * @return string|null
570    *   The name of the entity's base table, or NULL if none exists.
571    */
572   public function getBaseTable();
573
574   /**
575    * Indicates whether the entity data is internal.
576    *
577    * This can be used in a scenario when it is not desirable to expose data of
578    * this entity type to an external system.
579    *
580    * The implications of this method are left to the discretion of the caller.
581    * For example, a module providing an HTTP API may not expose entities of
582    * this type or a custom entity reference field settings form may deprioritize
583    * entities of this type in a select list.
584    *
585    * @return bool
586    *   TRUE if the entity data is internal, FALSE otherwise.
587    *
588    * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal()
589    */
590   public function isInternal();
591
592   /**
593    * Indicates whether entities of this type have multilingual support.
594    *
595    * At an entity level, this indicates language support and at a bundle level
596    * this indicates translation support.
597    *
598    * @return bool
599    */
600   public function isTranslatable();
601
602   /**
603    * Indicates whether the revision form fields should be added to the form.
604    *
605    * @return bool
606    *   TRUE if the form field should be added, FALSE otherwise.
607    */
608   public function showRevisionUi();
609
610   /**
611    * Indicates whether entities of this type have revision support.
612    *
613    * @return bool
614    */
615   public function isRevisionable();
616
617   /**
618    * Gets the name of the entity's revision data table.
619    *
620    * @todo Used by SqlContentEntityStorage only.
621    *
622    * @return string|null
623    *   The name of the entity type's revision data table, or NULL if none
624    *   exists.
625    */
626   public function getRevisionDataTable();
627
628   /**
629    * Gets the name of the entity's revision table.
630    *
631    * @todo Used by SqlContentEntityStorage only.
632    *
633    * @return string|null
634    *   The name of the entity type's revision table, or NULL if none exists.
635    */
636   public function getRevisionTable();
637
638   /**
639    * Gets the name of the entity's data table.
640    *
641    * @todo Used by SqlContentEntityStorage only.
642    *
643    * @return string|null
644    *   The name of the entity type's data table, or NULL if none exists.
645    */
646   public function getDataTable();
647
648   /**
649    * Gets the human-readable name of the entity type.
650    *
651    * This label should be used to present a human-readable name of the
652    * entity type.
653    *
654    * @return string
655    *   The human-readable name of the entity type.
656    */
657   public function getLabel();
658
659   /**
660    * Gets the lowercase form of the human-readable entity type name.
661    *
662    * @return string
663    *   The lowercase form of the human-readable entity type name.
664    *
665    * @see \Drupal\Core\Entity\EntityTypeInterface::getLabel()
666    */
667   public function getLowercaseLabel();
668
669   /**
670    * Gets the uppercase plural form of the name of the entity type.
671    *
672    * This should return a human-readable version of the name that can refer
673    * to all the entities of the given type, collectively. An example usage of
674    * this is the page title of a page devoted to a collection of entities such
675    * as "Workflows" (instead of "Workflow entities").
676    *
677    * @return string
678    *   The collection label.
679    */
680   public function getCollectionLabel();
681
682   /**
683    * Gets the indefinite singular form of the name of the entity type.
684    *
685    * This should return the human-readable name for a single instance of
686    * the entity type. For example: "opportunity" (with the plural as
687    * "opportunities"), "child" (with the plural as "children"), or "content
688    * item" (with the plural as "content items").
689    *
690    * @return string
691    *   The singular label.
692    */
693   public function getSingularLabel();
694
695   /**
696    * Gets the indefinite plural form of the name of the entity type.
697    *
698    * This should return the human-readable name for more than one instance of
699    * the entity type. For example: "opportunities" (with the singular as
700    * "opportunity"), "children" (with the singular as "child"), or "content
701    * items" (with the singular as "content item").
702    *
703    * @return string
704    *   The plural label.
705    */
706   public function getPluralLabel();
707
708   /**
709    * Gets the label's definite article form for use with a count of entities.
710    *
711    * This label should be used when the quantity of entities is provided. The
712    * name should be returned in a form usable with a count of the
713    * entities. For example: "1 opportunity", "5 opportunities", "1 child",
714    * "6 children", "1 content item", "25 content items".
715    *
716    * @param int $count
717    *   The item count to display if the plural form was requested.
718    *
719    * @return string
720    *   The count label.
721    */
722   public function getCountLabel($count);
723
724   /**
725    * Gets a callable that can be used to provide the entity URI.
726    *
727    * This is only called if there is no matching link template for the link
728    * relationship type, and there is no bundle-specific callback provided.
729    *
730    * @return callable|null
731    *   A valid callback that is passed the entity or NULL if none is specified.
732    */
733   public function getUriCallback();
734
735   /**
736    * Sets a callable to use to provide the entity URI.
737    *
738    * @param callable $callback
739    *   A callback to use to provide a URI for the entity.
740    *
741    * @return $this
742    */
743   public function setUriCallback($callback);
744
745   /**
746    * Gets the machine name of the entity type group.
747    *
748    * @return string
749    */
750   public function getGroup();
751
752   /**
753    * Gets the human-readable name of the entity type group.
754    *
755    * @return string
756    */
757   public function getGroupLabel();
758
759   /**
760    * The list cache contexts associated with this entity type.
761    *
762    * Enables code listing entities of this type to ensure that rendered listings
763    * are varied as necessary, typically to ensure users of role A see other
764    * entities listed than users of role B.
765    *
766    * @return string[]
767    */
768   public function getListCacheContexts();
769
770   /**
771    * The list cache tags associated with this entity type.
772    *
773    * Enables code listing entities of this type to ensure that newly created
774    * entities show up immediately.
775    *
776    * @return string[]
777    */
778   public function getListCacheTags();
779
780   /**
781    * Gets the key that is used to store configuration dependencies.
782    *
783    * @return string
784    *   The key to be used in configuration dependencies when storing
785    *   dependencies on entities of this type.
786    */
787   public function getConfigDependencyKey();
788
789   /**
790    * Indicates whether this entity type is commonly used as a reference target.
791    *
792    * @return bool
793    *   TRUE if the entity type is a common reference; FALSE otherwise.
794    */
795   public function isCommonReferenceTarget();
796
797   /**
798    * Gets an array of validation constraints.
799    *
800    * See \Drupal\Core\TypedData\DataDefinitionInterface::getConstraints() for
801    * details on how constraints are defined.
802    *
803    * @return array[]
804    *   An array of validation constraint definitions, keyed by constraint name.
805    *   Each constraint definition can be used for instantiating
806    *   \Symfony\Component\Validator\Constraint objects.
807    *
808    * @see \Symfony\Component\Validator\Constraint
809    */
810   public function getConstraints();
811
812   /**
813    * Sets the array of validation constraints for the FieldItemList.
814    *
815    * NOTE: This will overwrite any previously set constraints. In most cases
816    * ContentEntityTypeInterface::addConstraint() should be used instead.
817    * See \Drupal\Core\TypedData\DataDefinitionInterface::getConstraints() for
818    * details on how constraints are defined.
819    *
820    * @param array $constraints
821    *   An array of validation constraint definitions, keyed by constraint name.
822    *   Each constraint definition can be used for instantiating
823    *   \Symfony\Component\Validator\Constraint objects.
824    *
825    * @return $this
826    *
827    * @see \Symfony\Component\Validator\Constraint
828    */
829   public function setConstraints(array $constraints);
830
831   /**
832    * Adds a validation constraint.
833    *
834    * See \Drupal\Core\TypedData\DataDefinitionInterface::getConstraints() for
835    * details on how constraints are defined.
836    *
837    * @param string $constraint_name
838    *   The name of the constraint to add, i.e. its plugin id.
839    * @param array|null $options
840    *   The constraint options as required by the constraint plugin, or NULL.
841    *
842    * @return $this
843    */
844   public function addConstraint($constraint_name, $options = NULL);
845
846   /**
847    * Gets the config dependency info for this entity, if any exists.
848    *
849    * @param string $bundle
850    *   The bundle name.
851    *
852    * @return array
853    *   An associative array containing the following keys:
854    *   - 'type': The config dependency type (e.g. 'module', 'config').
855    *   - 'name': The name of the config dependency.
856    */
857   public function getBundleConfigDependency($bundle);
858
859 }