Posted by podarok on February 27, 2013 at 1:21pm
Project:
Drupal core
Introduced in branch:
8.x Issues:
Description:
Drupal 7
<?php
$allEntities = entity_get_info();
$nodeEntity = entity_get_info('node');
?>Drupal 8
<?php
/**
* Gets the entity definition for an entity type.
*
* @param string|null $entity_type
* (optional) The entity type (e.g. 'node'). Leave NULL to retrieve
* information for all entity types.
*
* @return array
* An array containing the entity type's definition, as retrieved with
* \Drupal\Core\Entity\EntityManager. If $entity_type is NULL, an associative
* array of all entity type definitions keyed by entity type is returned.
*
* @see \Drupal\Core\Entity\EntityManager
* @see hook_entity_info_alter()
*/
$allEntities = Drupal::service('plugin.manager.entity')->getDefinitions();
$nodeEntity = Drupal::service('plugin.manager.entity')->getDefinition('node');
?>Impacts:
Module developers
Comments
Is there an issue for this,
Is there an issue for this, because I still see the wrapper function in entity.inc. And, fwiw, I despise this change.
--
http://ken.therickards.com
I didn`t find issue yet,
I didn`t find issue yet, possibly this needs @todo )
The entity_get_info() marked as deprecated in sources but there were no any change-records before this one
---------------
Andriy Podanenko
web(uk, ru, en)
personal blog(uk, ru)
fixed )
fixed )
---------------
Andriy Podanenko
web(uk, ru, en)
personal blog(uk, ru)
This notice is wrong
[edit]
I read the issue, and there is nothing relevant to marking this function as deprecated. I don't understand this change notice. Removing entity_get_info() in this manner is horrible DX. You are ripping out an API function for an obscure chained method.
Why would we do that? We didn't deprecate entity_create().
--
http://ken.therickards.com
#1892462-16: Change record:
#1892462-16: EntityManager should use the CacheDecorator patch commits @deprecated
---------------
Andriy Podanenko
web(uk, ru, en)
personal blog(uk, ru)