EntityManager.php 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915
  1. <?php
  2. namespace Drupal\Core\Entity;
  3. use Drupal\Core\Field\FieldDefinitionInterface;
  4. use Drupal\Core\Field\FieldStorageDefinitionInterface;
  5. use Symfony\Component\DependencyInjection\ContainerAwareInterface;
  6. use Symfony\Component\DependencyInjection\ContainerAwareTrait;
  7. /**
  8. * Provides a wrapper around many other services relating to entities.
  9. *
  10. * Deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. We cannot
  11. * use the deprecated PHPDoc tag because this service class is still used in
  12. * legacy code paths. Symfony would fail test cases with deprecation warnings.
  13. */
  14. class EntityManager implements EntityManagerInterface, ContainerAwareInterface {
  15. use ContainerAwareTrait;
  16. /**
  17. * {@inheritdoc}
  18. *
  19. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  20. * Use \Drupal\Core\Entity\EntityTypeManagerInterface::clearCachedDefinitions()
  21. * instead.
  22. *
  23. * @see https://www.drupal.org/node/2549139
  24. */
  25. public function clearCachedDefinitions() {
  26. @trigger_error('EntityManagerInterface::clearCachedDefinitions() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeManagerInterface::clearCachedDefinitions() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  27. $this->container->get('entity_type.manager')->clearCachedDefinitions();
  28. // @todo None of these are plugin managers, and they should not co-opt
  29. // this method for managing its caches. Remove in
  30. // https://www.drupal.org/node/2549143.
  31. $this->container->get('entity_type.bundle.info')->clearCachedBundles();
  32. $this->container->get('entity_field.manager')->clearCachedFieldDefinitions();
  33. $this->container->get('entity_type.repository')->clearCachedDefinitions();
  34. }
  35. /**
  36. * {@inheritdoc}
  37. *
  38. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  39. * Use \Drupal\Core\Entity\EntityTypeManagerInterface::getDefinition()
  40. * instead.
  41. *
  42. * @see https://www.drupal.org/node/2549139
  43. */
  44. public function getDefinition($entity_type_id, $exception_on_invalid = TRUE) {
  45. @trigger_error('EntityManagerInterface::getDefinition() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Entity\EntityTypeManager::getDefinition() instead. See https://www.drupal.org/node/2549139', E_USER_DEPRECATED);
  46. return $this->container->get('entity_type.manager')->getDefinition($entity_type_id, $exception_on_invalid);
  47. }
  48. /**
  49. * {@inheritdoc}
  50. *
  51. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  52. * Use \Drupal\Core\Entity\EntityTypeManagerInterface::hasHandler()
  53. * instead.
  54. *
  55. * @see https://www.drupal.org/node/2549139
  56. */
  57. public function hasHandler($entity_type_id, $handler_type) {
  58. @trigger_error('EntityManagerInterface::hasHandler() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Entity\EntityTypeManager::hasHandler() instead. See https://www.drupal.org/node/2549139', E_USER_DEPRECATED);
  59. return $this->container->get('entity_type.manager')->hasHandler($entity_type_id, $handler_type);
  60. }
  61. /**
  62. * {@inheritdoc}
  63. *
  64. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  65. * Use \Drupal\Core\Entity\EntityTypeManagerInterface::getStorage() instead.
  66. *
  67. * @see https://www.drupal.org/node/2549139
  68. */
  69. public function getStorage($entity_type_id) {
  70. @trigger_error('EntityManagerInterface::getStorage() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Entity\EntityTypeManager::getStorage() instead. See https://www.drupal.org/node/2549139', E_USER_DEPRECATED);
  71. return $this->container->get('entity_type.manager')->getStorage($entity_type_id);
  72. }
  73. /**
  74. * {@inheritdoc}
  75. *
  76. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  77. * Use \Drupal\Core\Entity\EntityTypeManagerInterface::getListBuilder()
  78. * instead.
  79. *
  80. * @see https://www.drupal.org/node/2549139
  81. */
  82. public function getListBuilder($entity_type_id) {
  83. @trigger_error('EntityManagerInterface::getListBuilder() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Entity\EntityTypeManager::getListBuilder() instead. See https://www.drupal.org/node/2549139', E_USER_DEPRECATED);
  84. return $this->container->get('entity_type.manager')->getListBuilder($entity_type_id);
  85. }
  86. /**
  87. * {@inheritdoc}
  88. *
  89. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  90. * Use \Drupal\Core\Entity\EntityTypeManagerInterface::getFormObject()
  91. * instead.
  92. *
  93. * @see https://www.drupal.org/node/2549139
  94. */
  95. public function getFormObject($entity_type_id, $operation) {
  96. @trigger_error('EntityManagerInterface::getFormObject() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Entity\EntityTypeManager::getFormObject() instead. See https://www.drupal.org/node/2549139', E_USER_DEPRECATED);
  97. return $this->container->get('entity_type.manager')->getFormObject($entity_type_id, $operation);
  98. }
  99. /**
  100. * {@inheritdoc}
  101. *
  102. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  103. * Use \Drupal\Core\Entity\EntityTypeManagerInterface::getRouteProviders()
  104. * instead.
  105. *
  106. * @see https://www.drupal.org/node/2549139
  107. */
  108. public function getRouteProviders($entity_type_id) {
  109. @trigger_error('EntityManagerInterface::getRouteProviders() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Entity\EntityTypeManager::getRouteProviders() instead. See https://www.drupal.org/node/2549139', E_USER_DEPRECATED);
  110. return $this->container->get('entity_type.manager')->getRouteProviders($entity_type_id);
  111. }
  112. /**
  113. * {@inheritdoc}
  114. *
  115. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  116. * Use \Drupal\Core\Entity\EntityTypeManagerInterface::getViewBuilder()
  117. * instead.
  118. *
  119. * @see https://www.drupal.org/node/2549139
  120. */
  121. public function getViewBuilder($entity_type_id) {
  122. @trigger_error('EntityManagerInterface::getViewBuilder() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Entity\EntityTypeManager::getViewBuilder() instead. See https://www.drupal.org/node/2549139', E_USER_DEPRECATED);
  123. return $this->container->get('entity_type.manager')->getViewBuilder($entity_type_id);
  124. }
  125. /**
  126. * {@inheritdoc}
  127. *
  128. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  129. * Use \Drupal\Core\Entity\EntityTypeManagerInterface::getAccessControlHandler()
  130. * instead.
  131. *
  132. * @see https://www.drupal.org/node/2549139
  133. */
  134. public function getAccessControlHandler($entity_type_id) {
  135. @trigger_error('EntityManagerInterface::getAccessControlHandler() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Entity\EntityTypeManager::getAccessControlHandler() instead. See https://www.drupal.org/node/2549139', E_USER_DEPRECATED);
  136. return $this->container->get('entity_type.manager')->getAccessControlHandler($entity_type_id);
  137. }
  138. /**
  139. * {@inheritdoc}
  140. *
  141. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  142. * Use \Drupal\Core\Entity\EntityTypeManagerInterface::getHandler() instead.
  143. *
  144. * @see https://www.drupal.org/node/2549139
  145. */
  146. public function getHandler($entity_type_id, $handler_type) {
  147. @trigger_error('EntityManagerInterface::getHandler() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Entity\EntityTypeManager::getHandler() instead. See https://www.drupal.org/node/2549139', E_USER_DEPRECATED);
  148. return $this->container->get('entity_type.manager')->getHandler($entity_type_id, $handler_type);
  149. }
  150. /**
  151. * {@inheritdoc}
  152. *
  153. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  154. * Use \Drupal\Core\Entity\EntityTypeManagerInterface::createHandlerInstance()
  155. * instead.
  156. *
  157. * @see https://www.drupal.org/node/2549139
  158. */
  159. public function createHandlerInstance($class, EntityTypeInterface $definition = NULL) {
  160. @trigger_error('EntityManagerInterface::createHandlerInstance() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Entity\EntityTypeManager::createHandlerInstance() instead. See https://www.drupal.org/node/2549139', E_USER_DEPRECATED);
  161. return $this->container->get('entity_type.manager')->createHandlerInstance($class, $definition);
  162. }
  163. /**
  164. * {@inheritdoc}
  165. *
  166. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  167. * Use \Drupal\Core\Entity\EntityFieldManagerInterface::getBaseFieldDefinitions()
  168. * instead.
  169. *
  170. * @see https://www.drupal.org/node/2549139
  171. */
  172. public function getBaseFieldDefinitions($entity_type_id) {
  173. @trigger_error('EntityManagerInterface::getBaseFieldDefinitions() is deprecated in drupal:8.0.0 and will be removed before drupal:9.0.0. Use \Drupal\Core\Entity\EntityFieldManagerInterface::getBaseFieldDefinitions() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  174. return $this->container->get('entity_field.manager')->getBaseFieldDefinitions($entity_type_id);
  175. }
  176. /**
  177. * {@inheritdoc}
  178. *
  179. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  180. * Use \Drupal\Core\Entity\EntityFieldManagerInterface::getFieldDefinitions()
  181. * instead.
  182. *
  183. * @see https://www.drupal.org/node/2549139
  184. */
  185. public function getFieldDefinitions($entity_type_id, $bundle) {
  186. @trigger_error('EntityManagerInterface::getFieldDefinitions() is deprecated in drupal:8.0.0 and will be removed before drupal:9.0.0. Use \Drupal\Core\Entity\EntityFieldManagerInterface::getFieldDefinitions() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  187. return $this->container->get('entity_field.manager')->getFieldDefinitions($entity_type_id, $bundle);
  188. }
  189. /**
  190. * {@inheritdoc}
  191. *
  192. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  193. * Use \Drupal\Core\Entity\EntityFieldManagerInterface::getFieldStorageDefinitions()
  194. * instead.
  195. *
  196. * @see https://www.drupal.org/node/2549139
  197. */
  198. public function getFieldStorageDefinitions($entity_type_id) {
  199. @trigger_error('EntityManagerInterface::getFieldStorageDefinitions() is deprecated in drupal:8.0.0 and will be removed before drupal:9.0.0. Use \Drupal\Core\Entity\EntityFieldManagerInterface::getFieldStorageDefinitions() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  200. return $this->container->get('entity_field.manager')->getFieldStorageDefinitions($entity_type_id);
  201. }
  202. /**
  203. * {@inheritdoc}
  204. *
  205. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  206. * Use \Drupal\Core\Entity\EntityFieldManagerInterface::getActiveFieldStorageDefinitions()
  207. * instead.
  208. *
  209. * @see https://www.drupal.org/node/3040966
  210. */
  211. public function getActiveFieldStorageDefinitions($entity_type_id) {
  212. @trigger_error('EntityManagerInterface::getActiveFieldStorageDefinitions() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityFieldManagerInterface::getActiveFieldStorageDefinitions() instead. See https://www.drupal.org/node/3040966.', E_USER_DEPRECATED);
  213. return $this->container->get('entity_field.manager')->getActiveFieldStorageDefinitions($entity_type_id);
  214. }
  215. /**
  216. * {@inheritdoc}
  217. *
  218. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  219. * Use \Drupal\Core\Entity\EntityFieldManagerInterface::setFieldMap()
  220. * instead.
  221. *
  222. * @see https://www.drupal.org/node/2549139
  223. */
  224. public function setFieldMap(array $field_map) {
  225. @trigger_error('EntityManagerInterface::setFieldMap() is deprecated in drupal:8.0.0 and will be removed before drupal:9.0.0. Use \Drupal\Core\Entity\EntityFieldManagerInterface::setFieldMap() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  226. return $this->container->get('entity_field.manager')->setFieldMap($field_map);
  227. }
  228. /**
  229. * {@inheritdoc}
  230. *
  231. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  232. * Use \Drupal\Core\Entity\EntityFieldManagerInterface::getFieldMap()
  233. * instead.
  234. *
  235. * @see https://www.drupal.org/node/2549139
  236. */
  237. public function getFieldMap() {
  238. @trigger_error('EntityManagerInterface::getFieldMap() is deprecated in drupal:8.0.0 and will be removed before drupal:9.0.0. Use \Drupal\Core\Entity\EntityFieldManagerInterface::getFieldMap() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  239. return $this->container->get('entity_field.manager')->getFieldMap();
  240. }
  241. /**
  242. * {@inheritdoc}
  243. *
  244. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  245. * Use \Drupal\Core\Entity\EntityFieldManagerInterface::getFieldMapByFieldType()
  246. * instead.
  247. *
  248. * @see https://www.drupal.org/node/2549139
  249. */
  250. public function getFieldMapByFieldType($field_type) {
  251. @trigger_error('EntityManagerInterface::getFieldMapByFieldType() is deprecated in drupal:8.0.0 and will be removed before drupal:9.0.0. Use \Drupal\Core\Entity\EntityFieldManagerInterface::getFieldMapByFieldType() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  252. return $this->container->get('entity_field.manager')->getFieldMapByFieldType($field_type);
  253. }
  254. /**
  255. * {@inheritdoc}
  256. *
  257. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  258. * Use \Drupal\Core\Field\FieldDefinitionListenerInterface::onFieldDefinitionCreate()
  259. * instead.
  260. *
  261. * @see https://www.drupal.org/node/2549139
  262. */
  263. public function onFieldDefinitionCreate(FieldDefinitionInterface $field_definition) {
  264. @trigger_error('EntityManagerInterface::onFieldDefinitionCreate() is deprecated in drupal:8.0.0 and will be removed before drupal:9.0.0. Use \Drupal\Core\Field\FieldDefinitionListenerInterface::onFieldDefinitionCreate() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  265. $this->container->get('field_definition.listener')->onFieldDefinitionCreate($field_definition);
  266. }
  267. /**
  268. * {@inheritdoc}
  269. *
  270. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  271. * Use \Drupal\Core\Field\FieldDefinitionListenerInterface::onFieldDefinitionUpdate()
  272. * instead.
  273. *
  274. * @see https://www.drupal.org/node/2549139
  275. */
  276. public function onFieldDefinitionUpdate(FieldDefinitionInterface $field_definition, FieldDefinitionInterface $original) {
  277. @trigger_error('EntityManagerInterface::onFieldDefinitionUpdate() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Field\FieldDefinitionListenerInterface::onFieldDefinitionUpdate() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  278. $this->container->get('field_definition.listener')->onFieldDefinitionUpdate($field_definition, $original);
  279. }
  280. /**
  281. * {@inheritdoc}
  282. *
  283. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  284. * Use \Drupal\Core\Field\FieldDefinitionListenerInterface::onFieldDefinitionDelete()
  285. * instead.
  286. *
  287. * @see https://www.drupal.org/node/2549139
  288. */
  289. public function onFieldDefinitionDelete(FieldDefinitionInterface $field_definition) {
  290. @trigger_error('EntityManagerInterface::onFieldDefinitionDelete() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Field\FieldDefinitionListenerInterface::onFieldDefinitionDelete() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  291. $this->container->get('field_definition.listener')->onFieldDefinitionDelete($field_definition);
  292. }
  293. /**
  294. * {@inheritdoc}
  295. *
  296. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  297. * Use \Drupal\Core\Entity\EntityFieldManagerInterface::clearCachedFieldDefinitions()
  298. * instead.
  299. *
  300. * @see https://www.drupal.org/node/2549139
  301. */
  302. public function clearCachedFieldDefinitions() {
  303. @trigger_error('EntityManagerInterface::clearCachedFieldDefinitions() is deprecated in drupal:8.0.0 and will be removed before drupal:9.0.0. Use \Drupal\Core\Entity\EntityFieldManagerInterface::clearCachedFieldDefinitions() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  304. $this->container->get('entity_field.manager')->clearCachedFieldDefinitions();
  305. }
  306. /**
  307. * {@inheritdoc}
  308. *
  309. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  310. * Use \Drupal\Core\Entity\EntityTypeBundleInfoInterface::clearCachedBundles()
  311. * instead.
  312. *
  313. * @see https://www.drupal.org/node/2549139
  314. */
  315. public function clearCachedBundles() {
  316. @trigger_error('EntityManagerInterface::clearCachedBundles() is deprecated in drupal:8.0.0 and will be removed before drupal:9.0.0. Use \Drupal\Core\Entity\EntityTypeBundleInfoInterface::clearCachedBundles() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  317. $this->container->get('entity_type.bundle.info')->clearCachedBundles();
  318. }
  319. /**
  320. * {@inheritdoc}
  321. *
  322. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  323. * Use \Drupal\Core\Entity\EntityTypeBundleInfoInterface::getBundleInfo()
  324. * instead.
  325. *
  326. * @see https://www.drupal.org/node/2549139
  327. */
  328. public function getBundleInfo($entity_type_id) {
  329. @trigger_error('EntityManagerInterface::getBundleInfo() is deprecated in drupal:8.0.0 and will be removed before drupal:9.0.0. Use \Drupal\Core\Entity\EntityTypeBundleInfoInterface::getBundleInfo() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  330. return $this->container->get('entity_type.bundle.info')->getBundleInfo($entity_type_id);
  331. }
  332. /**
  333. * {@inheritdoc}
  334. *
  335. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  336. * Use \Drupal\Core\Entity\EntityTypeBundleInfoInterface::getAllBundleInfo()
  337. * instead.
  338. *
  339. * @see https://www.drupal.org/node/2549139
  340. */
  341. public function getAllBundleInfo() {
  342. @trigger_error('EntityManagerInterface::getAllBundleInfo() is deprecated in drupal:8.0.0 and will be removed before drupal:9.0.0. Use \Drupal\Core\Entity\EntityTypeBundleInfoInterface::getAllBundleInfo() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  343. return $this->container->get('entity_type.bundle.info')->getAllBundleInfo();
  344. }
  345. /**
  346. * {@inheritdoc}
  347. *
  348. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  349. * Use \Drupal\Core\Entity\EntityFieldManagerInterface::getExtraFields()
  350. * instead.
  351. *
  352. * @see https://www.drupal.org/node/2549139
  353. */
  354. public function getExtraFields($entity_type_id, $bundle) {
  355. @trigger_error('EntityManagerInterface::getExtraFields() is deprecated in drupal:8.0.0 and will be removed before drupal:9.0.0. Use \Drupal\Core\Entity\EntityFieldManagerInterface::getExtraFields() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  356. return $this->container->get('entity_field.manager')->getExtraFields($entity_type_id, $bundle);
  357. }
  358. /**
  359. * {@inheritdoc}
  360. *
  361. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  362. * Use \Drupal\Core\Entity\EntityTypeRepositoryInterface::getEntityTypeLabels()
  363. * instead.
  364. *
  365. * @see https://www.drupal.org/node/2549139
  366. */
  367. public function getEntityTypeLabels($group = FALSE) {
  368. @trigger_error('EntityManagerInterface::getEntityTypeLabels() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeRepositoryInterface::getEntityTypeLabels() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  369. return $this->container->get('entity_type.repository')->getEntityTypeLabels($group);
  370. }
  371. /**
  372. * {@inheritdoc}
  373. *
  374. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  375. * Use \Drupal\Core\Entity\EntityRepositoryInterface::getTranslationFromContext()
  376. * instead.
  377. *
  378. * @see https://www.drupal.org/node/2549139
  379. */
  380. public function getTranslationFromContext(EntityInterface $entity, $langcode = NULL, $context = []) {
  381. @trigger_error('EntityManagerInterface::getTranslationFromContext() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityRepository::getTranslationFromContext() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  382. return $this->container->get('entity.repository')->getTranslationFromContext($entity, $langcode, $context);
  383. }
  384. /**
  385. * {@inheritdoc}
  386. *
  387. * @deprecated in drupal:8.7.0 and is removed from drupal:9.0.0.
  388. * Use \Drupal\Core\Entity\EntityRepositoryInterface::getActive() instead.
  389. *
  390. * @see https://www.drupal.org/node/2549139
  391. */
  392. public function getActive($entity_type_id, $entity_id, array $contexts = NULL) {
  393. @trigger_error('EntityManagerInterface::getActive() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityRepositoryInterface::getActive() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  394. return $this->container->get('entity.repository')->getActive($entity_type_id, $entity_id, $contexts);
  395. }
  396. /**
  397. * {@inheritdoc}
  398. *
  399. * @deprecated in drupal:8.7.0 and is removed from drupal:9.0.0.
  400. * Use \Drupal\Core\Entity\EntityRepositoryInterface::getActiveMultiple()
  401. * instead.
  402. *
  403. * @see https://www.drupal.org/node/2549139
  404. */
  405. public function getActiveMultiple($entity_type_id, array $entity_ids, array $contexts = NULL) {
  406. @trigger_error('EntityManagerInterface::getActiveMultiple() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityRepositoryInterface::getActiveMultiple() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  407. return $this->container->get('entity.repository')->getActiveMultiple($entity_type_id, $entity_ids, $contexts);
  408. }
  409. /**
  410. * {@inheritdoc}
  411. *
  412. * @deprecated in drupal:8.7.0 and is removed from drupal:9.0.0.
  413. * Use \Drupal\Core\Entity\EntityRepositoryInterface::getCanonical()
  414. * instead.
  415. *
  416. * @see https://www.drupal.org/node/2549139
  417. */
  418. public function getCanonical($entity_type_id, $entity_id, array $contexts = NULL) {
  419. @trigger_error('EntityManagerInterface::getCanonical() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityRepositoryInterface::getCanonical() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  420. return $this->container->get('entity.repository')->getCanonical($entity_type_id, $entity_id, $contexts);
  421. }
  422. /**
  423. * {@inheritdoc}
  424. *
  425. * @deprecated in drupal:8.7.0 and is removed from drupal:9.0.0.
  426. * Use \Drupal\Core\Entity\EntityRepositoryInterface::getCanonicalMultiple()
  427. * instead.
  428. *
  429. * @see https://www.drupal.org/node/2549139
  430. */
  431. public function getCanonicalMultiple($entity_type_id, array $entity_ids, array $contexts = NULL) {
  432. @trigger_error('EntityManagerInterface::getCanonicalMultiple() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityRepositoryInterface::getCanonicalMultiple() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  433. return $this->container->get('entity.repository')->getCanonicalMultiple($entity_type_id, $entity_ids, $contexts);
  434. }
  435. /**
  436. * {@inheritdoc}
  437. *
  438. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  439. * Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getAllViewModes()
  440. * instead.
  441. *
  442. * @see https://www.drupal.org/node/2549139
  443. */
  444. public function getAllViewModes() {
  445. @trigger_error('EntityManagerInterface::getAllViewModes() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getAllViewModes() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  446. return $this->container->get('entity_display.repository')->getAllViewModes();
  447. }
  448. /**
  449. * {@inheritdoc}
  450. *
  451. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  452. * Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getViewModes()
  453. * instead.
  454. *
  455. * @see https://www.drupal.org/node/2549139
  456. */
  457. public function getViewModes($entity_type_id) {
  458. @trigger_error('EntityManagerInterface::getViewModes() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getViewModes() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  459. return $this->container->get('entity_display.repository')->getViewModes($entity_type_id);
  460. }
  461. /**
  462. * {@inheritdoc}
  463. *
  464. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  465. * Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getAllFormModes()
  466. * instead.
  467. *
  468. * @see https://www.drupal.org/node/2549139
  469. */
  470. public function getAllFormModes() {
  471. @trigger_error('EntityManagerInterface::getAllFormModes() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getAllFormModes() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  472. return $this->container->get('entity_display.repository')->getAllFormModes();
  473. }
  474. /**
  475. * {@inheritdoc}
  476. *
  477. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  478. * Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getFormModes()
  479. * instead.
  480. *
  481. * @see https://www.drupal.org/node/2549139
  482. */
  483. public function getFormModes($entity_type_id) {
  484. @trigger_error('EntityManagerInterface::getFormModes() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getFormModes() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  485. return $this->container->get('entity_display.repository')->getFormModes($entity_type_id);
  486. }
  487. /**
  488. * {@inheritdoc}
  489. *
  490. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  491. * Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getViewModeOptions()
  492. * instead.
  493. *
  494. * @see https://www.drupal.org/node/2549139
  495. */
  496. public function getViewModeOptions($entity_type_id) {
  497. @trigger_error('EntityManagerInterface::getViewModeOptions() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getViewModeOptions() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  498. return $this->container->get('entity_display.repository')->getViewModeOptions($entity_type_id);
  499. }
  500. /**
  501. * {@inheritdoc}
  502. *
  503. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  504. * Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getFormModeOptions()
  505. * instead.
  506. *
  507. * @see https://www.drupal.org/node/2549139
  508. */
  509. public function getFormModeOptions($entity_type_id) {
  510. @trigger_error('EntityManagerInterface::getFormModeOptions() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getFormModeOptions() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  511. return $this->container->get('entity_display.repository')->getFormModeOptions($entity_type_id);
  512. }
  513. /**
  514. * {@inheritdoc}
  515. *
  516. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  517. * Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getViewModeOptionsByBundle()
  518. * instead.
  519. *
  520. * @see https://www.drupal.org/node/2549139
  521. */
  522. public function getViewModeOptionsByBundle($entity_type_id, $bundle) {
  523. @trigger_error('EntityManagerInterface::getViewModeOptionsByBundle() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getViewModeOptionsByBundle() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  524. return $this->container->get('entity_display.repository')->getViewModeOptionsByBundle($entity_type_id, $bundle);
  525. }
  526. /**
  527. * {@inheritdoc}
  528. *
  529. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  530. * Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getFormModeOptionsByBundle()
  531. * instead.
  532. *
  533. * @see https://www.drupal.org/node/2549139
  534. */
  535. public function getFormModeOptionsByBundle($entity_type_id, $bundle) {
  536. @trigger_error('EntityManagerInterface::getFormModeOptionsByBundle() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::getFormModeOptionsByBundle() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  537. return $this->container->get('entity_display.repository')->getFormModeOptionsByBundle($entity_type_id, $bundle);
  538. }
  539. /**
  540. * {@inheritdoc}
  541. *
  542. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  543. * Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::clearDisplayModeInfo()
  544. * instead.
  545. *
  546. * @see https://www.drupal.org/node/2549139
  547. */
  548. public function clearDisplayModeInfo() {
  549. @trigger_error('EntityManagerInterface::clearDisplayModeInfo() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDisplayRepositoryInterface::clearDisplayModeInfo() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  550. $this->container->get('entity_display.repository')->clearDisplayModeInfo();
  551. return $this;
  552. }
  553. /**
  554. * {@inheritdoc}
  555. *
  556. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  557. * Use \Drupal\Core\Entity\EntityRepositoryInterface::loadEntityByUuid()
  558. * instead.
  559. *
  560. * @see https://www.drupal.org/node/2549139
  561. */
  562. public function loadEntityByUuid($entity_type_id, $uuid) {
  563. @trigger_error('EntityManagerInterface::loadEntityByUuid() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityRepository::loadEntityByUuid() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  564. return $this->container->get('entity.repository')->loadEntityByUuid($entity_type_id, $uuid);
  565. }
  566. /**
  567. * {@inheritdoc}
  568. *
  569. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  570. * Use \Drupal\Core\Entity\EntityRepositoryInterface::loadEntityByConfigTarget()
  571. * instead.
  572. *
  573. * @see https://www.drupal.org/node/2549139
  574. */
  575. public function loadEntityByConfigTarget($entity_type_id, $target) {
  576. @trigger_error('EntityManagerInterface::loadEntityByConfigTarget() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityRepository::loadEntityByConfigTarget() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  577. return $this->container->get('entity.repository')->loadEntityByConfigTarget($entity_type_id, $target);
  578. }
  579. /**
  580. * {@inheritdoc}
  581. *
  582. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  583. * Use \Drupal\Core\Entity\EntityTypeRepositoryInterface::getEntityTypeFromClass()
  584. * instead.
  585. *
  586. * @see https://www.drupal.org/node/2549139
  587. */
  588. public function getEntityTypeFromClass($class_name) {
  589. @trigger_error('EntityManagerInterface::getEntityTypeFromClass() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeRepositoryInterface::getEntityTypeFromClass() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  590. return $this->container->get('entity_type.repository')->getEntityTypeFromClass($class_name);
  591. }
  592. /**
  593. * {@inheritdoc}
  594. */
  595. public function onEntityTypeCreate(EntityTypeInterface $entity_type) {
  596. @trigger_error('EntityManagerInterface::onEntityTypeCreate() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeListenerInterface::onEntityTypeCreate() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  597. $this->container->get('entity_type.listener')->onEntityTypeCreate($entity_type);
  598. }
  599. /**
  600. * {@inheritdoc}
  601. *
  602. * @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0.
  603. * Use \Drupal\Core\Entity\EntityTypeListenerInterface::onFieldableEntityTypeCreate()
  604. * instead.
  605. *
  606. * @see https://www.drupal.org/project/drupal/issues/3043455
  607. */
  608. public function onFieldableEntityTypeCreate(EntityTypeInterface $entity_type, array $field_storage_definitions) {
  609. $this->container->get('entity_type.listener')->onFieldableEntityTypeCreate($entity_type, $field_storage_definitions);
  610. }
  611. /**
  612. * {@inheritdoc}
  613. *
  614. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  615. * Use \Drupal\Core\Entity\EntityTypeListenerInterface::onEntityTypeUpdate()
  616. * instead.
  617. *
  618. * @see https://www.drupal.org/node/2549139
  619. */
  620. public function onEntityTypeUpdate(EntityTypeInterface $entity_type, EntityTypeInterface $original) {
  621. @trigger_error('EntityManagerInterface::onEntityTypeUpdate() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeListenerInterface::onEntityTypeUpdate() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  622. $this->container->get('entity_type.listener')->onEntityTypeUpdate($entity_type, $original);
  623. }
  624. /**
  625. * {@inheritdoc}
  626. *
  627. * @deprecated in drupal:8.7.0 and is removed from drupal:9.0.0.
  628. * Use \Drupal\Core\Entity\EntityTypeListenerInterface::onFieldableEntityTypeUpdate()
  629. * instead.
  630. *
  631. * @see https://www.drupal.org/project/drupal/issues/2984782
  632. */
  633. public function onFieldableEntityTypeUpdate(EntityTypeInterface $entity_type, EntityTypeInterface $original, array $field_storage_definitions, array $original_field_storage_definitions, array &$sandbox = NULL) {
  634. $this->container->get('entity_type.listener')->onFieldableEntityTypeUpdate($entity_type, $original, $field_storage_definitions, $original_field_storage_definitions, $sandbox);
  635. }
  636. /**
  637. * {@inheritdoc}
  638. *
  639. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  640. * Use \Drupal\Core\Entity\EntityTypeListenerInterface::onEntityTypeDelete()
  641. * instead.
  642. *
  643. * @see https://www.drupal.org/node/2549139
  644. */
  645. public function onEntityTypeDelete(EntityTypeInterface $entity_type) {
  646. @trigger_error('EntityManagerInterface::onEntityTypeDelete() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeListenerInterface::onEntityTypeDelete() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  647. $this->container->get('entity_type.listener')->onEntityTypeDelete($entity_type);
  648. }
  649. /**
  650. * {@inheritdoc}
  651. *
  652. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  653. * Use \Drupal\Core\Field\FieldStorageDefinitionListenerInterface::onFieldStorageDefinitionCreate()
  654. * instead.
  655. *
  656. * @see https://www.drupal.org/node/2549139
  657. */
  658. public function onFieldStorageDefinitionCreate(FieldStorageDefinitionInterface $storage_definition) {
  659. @trigger_error('EntityManagerInterface::onFieldStorageDefinitionCreate() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Field\FieldStorageDefinitionListenerInterface::onFieldStorageDefinitionCreate() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  660. $this->container->get('field_storage_definition.listener')->onFieldStorageDefinitionCreate($storage_definition);
  661. }
  662. /**
  663. * {@inheritdoc}
  664. *
  665. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  666. * Use \Drupal\Core\Field\FieldStorageDefinitionListenerInterface::onFieldStorageDefinitionUpdate()
  667. * instead.
  668. *
  669. * @see https://www.drupal.org/node/2549139
  670. */
  671. public function onFieldStorageDefinitionUpdate(FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original) {
  672. @trigger_error('EntityManagerInterface::onFieldStorageDefinitionUpdate() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Field\FieldStorageDefinitionListenerInterface::onFieldStorageDefinitionUpdate() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  673. $this->container->get('field_storage_definition.listener')->onFieldStorageDefinitionUpdate($storage_definition, $original);
  674. }
  675. /**
  676. * {@inheritdoc}
  677. *
  678. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  679. * Use \Drupal\Core\Field\FieldStorageDefinitionListenerInterface::onFieldStorageDefinitionDelete()
  680. * instead.
  681. *
  682. * @see https://www.drupal.org/node/2549139
  683. */
  684. public function onFieldStorageDefinitionDelete(FieldStorageDefinitionInterface $storage_definition) {
  685. @trigger_error('EntityManagerInterface::onFieldStorageDefinitionDelete() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Field\FieldStorageDefinitionListenerInterface::onFieldStorageDefinitionDelete() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  686. $this->container->get('field_storage_definition.listener')->onFieldStorageDefinitionDelete($storage_definition);
  687. }
  688. /**
  689. * {@inheritdoc}
  690. *
  691. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  692. * Use \Drupal\Core\Entity\EntityBundleListenerInterface::onBundleCreate()
  693. * instead.
  694. *
  695. * @see https://www.drupal.org/node/2549139
  696. */
  697. public function onBundleCreate($bundle, $entity_type_id) {
  698. @trigger_error('EntityManagerInterface::onBundleCreate() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityBundleListenerInterface::onBundleCreate() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  699. $this->container->get('entity_bundle.listener')->onBundleCreate($bundle, $entity_type_id);
  700. }
  701. /**
  702. * {@inheritdoc}
  703. *
  704. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  705. * Use \Drupal\Core\Entity\EntityBundleListenerInterface::onBundleDelete()
  706. * instead.
  707. *
  708. * @see https://www.drupal.org/node/2549139
  709. */
  710. public function onBundleDelete($bundle, $entity_type_id) {
  711. @trigger_error('EntityManagerInterface::onBundleDelete() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityBundleListenerInterface::onBundleDelete() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  712. $this->container->get('entity_bundle.listener')->onBundleDelete($bundle, $entity_type_id);
  713. }
  714. /**
  715. * {@inheritdoc}
  716. *
  717. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  718. * Use \Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface::getLastInstalledDefinition()
  719. * instead.
  720. *
  721. * @see https://www.drupal.org/node/2549139
  722. */
  723. public function getLastInstalledDefinition($entity_type_id) {
  724. @trigger_error('EntityManagerInterface::getLastInstalledDefinition() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface::getLastInstalledDefinition() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  725. return $this->container->get('entity.last_installed_schema.repository')->getLastInstalledDefinition($entity_type_id);
  726. }
  727. /**
  728. * {@inheritdoc}
  729. *
  730. * @deprecated EntityManagerInterface::useCaches() is deprecated in 8.0.0 and
  731. * will be removed before Drupal 9.0.0. Use
  732. * \Drupal\Core\Entity\EntityTypeManagerInterface::useCaches() and/or
  733. * Drupal\Core\Entity\EntityFieldManagerInterface::useCaches() instead.
  734. *
  735. * @see https://www.drupal.org/node/2549139
  736. */
  737. public function useCaches($use_caches = FALSE) {
  738. @trigger_error('EntityManagerInterface::useCaches() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeManagerInterface::useCaches() and/or Drupal\Core\Entity\EntityFieldManagerInterface::useCaches() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  739. $this->container->get('entity_type.manager')->useCaches($use_caches);
  740. // @todo EntityFieldManager is not a plugin manager, and should not co-opt
  741. // this method for managing its caches.
  742. $this->container->get('entity_field.manager')->useCaches($use_caches);
  743. }
  744. /**
  745. * {@inheritdoc}
  746. *
  747. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  748. * Use \Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface::getLastInstalledFieldStorageDefinitions()
  749. * instead.
  750. *
  751. * @see https://www.drupal.org/node/2549139
  752. */
  753. public function getLastInstalledFieldStorageDefinitions($entity_type_id) {
  754. @trigger_error('EntityManagerInterface::getLastInstalledFieldStorageDefinitions() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface::getLastInstalledFieldStorageDefinitions() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  755. return $this->container->get('entity.last_installed_schema.repository')->getLastInstalledFieldStorageDefinitions($entity_type_id);
  756. }
  757. /**
  758. * {@inheritdoc}
  759. *
  760. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  761. * Use \Drupal\Core\Entity\EntityTypeManagerInterface::getDefinitions()
  762. * instead.
  763. *
  764. * @see https://www.drupal.org/node/2549139
  765. */
  766. public function getDefinitions() {
  767. @trigger_error('EntityManagerInterface::getDefinitions() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Entity\EntityTypeManager::getDefinitions() instead. See https://www.drupal.org/node/2549139', E_USER_DEPRECATED);
  768. return $this->container->get('entity_type.manager')->getDefinitions();
  769. }
  770. /**
  771. * {@inheritdoc}
  772. *
  773. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  774. * Use \Drupal\Core\Entity\EntityTypeManagerInterface::hasDefinition()
  775. * instead.
  776. *
  777. * @see https://www.drupal.org/node/2549139
  778. */
  779. public function hasDefinition($plugin_id) {
  780. @trigger_error('EntityManagerInterface::hasDefinition() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Entity\EntityTypeManager::hasDefinition() instead. See https://www.drupal.org/node/2549139', E_USER_DEPRECATED);
  781. return $this->container->get('entity_type.manager')->hasDefinition($plugin_id);
  782. }
  783. /**
  784. * {@inheritdoc}
  785. *
  786. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  787. * Use \Drupal\Core\Entity\EntityTypeManagerInterface::getActiveDefinition()
  788. * instead.
  789. *
  790. * @see https://www.drupal.org/node/3040966
  791. */
  792. public function getActiveDefinition($entity_type_id) {
  793. @trigger_error('EntityManagerInterface::getActiveDefinition() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeManagerInterface::getActiveDefinition() instead. See https://www.drupal.org/node/3040966.', E_USER_DEPRECATED);
  794. return $this->container->get('entity_type.manager')->getActiveDefinition($entity_type_id);
  795. }
  796. /**
  797. * {@inheritdoc}
  798. *
  799. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  800. * Use \Drupal\Core\Entity\EntityTypeManagerInterface::createInstance()
  801. * instead.
  802. *
  803. * @see https://www.drupal.org/node/2549139
  804. */
  805. public function createInstance($plugin_id, array $configuration = []) {
  806. @trigger_error('EntityManagerInterface::createInstance() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeManagerInterface::createInstance() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  807. return $this->container->get('entity_type.manager')->createInstance($plugin_id, $configuration);
  808. }
  809. /**
  810. * {@inheritdoc}
  811. *
  812. * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0.
  813. * Use \Drupal\Core\Entity\EntityTypeManagerInterface::getInstance()
  814. * instead.
  815. *
  816. * @see https://www.drupal.org/node/2549139
  817. */
  818. public function getInstance(array $options) {
  819. @trigger_error('EntityManagerInterface::getInstance() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityTypeManagerInterface::getInstance() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  820. return $this->container->get('entity_type.manager')->getInstance($options);
  821. }
  822. /**
  823. * {@inheritdoc}
  824. *
  825. * @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0.
  826. * Use \Drupal\Core\Entity\EntityTypeManagerInterface::getViewDisplay()
  827. * instead.
  828. */
  829. public function getViewDisplay($entity_type, $bundle, $view_mode = self::DEFAULT_DISPLAY_MODE) {
  830. @trigger_error('EntityManager::getViewDisplay() is deprecated in drupal:8.8.0 and will be removed before Drupal 9.0.0. Use \Drupal::service(\'entity_display.repository\')->getViewDisplay() instead.', E_USER_DEPRECATED);
  831. return $this->container->get('entity_display.repository')->getViewDisplay($entity_type, $bundle, $view_mode);
  832. }
  833. /**
  834. * {@inheritdoc}
  835. *
  836. * @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0.
  837. * Use \Drupal\Core\Entity\EntityTypeManagerInterface::getFormwDisplay()
  838. * instead.
  839. */
  840. public function getFormDisplay($entity_type, $bundle, $form_mode = self::DEFAULT_DISPLAY_MODE) {
  841. @trigger_error('EntityManager::getFormDisplay() is deprecated in drupal:8.8.0 and will be removed before Drupal 9.0.0. Use \Drupal::service(\'entity_display.repository\')->getFormDisplay() instead.', E_USER_DEPRECATED);
  842. return $this->container->get('entity_display.repository')->getFormDisplay($entity_type, $bundle, $form_mode);
  843. }
  844. }