public static function EntityBrowserFormTrait::loadEntityBrowserEntity in Helper 8
Loads entity based on an ID in the format entity_type:entity_id.
Parameters
string $id: An ID.
Return value
\Drupal\Core\Entity\EntityInterface A loaded entity.
File
- src/
EntityBrowserFormTrait.php, line 81
Class
- EntityBrowserFormTrait
- Provides helpers for adding an entity browser element to a form.
Namespace
Drupal\helperCode
public static function loadEntityBrowserEntity($id) {
$entities = static::loadEntityBrowserEntitiesByIds($id);
return reset($entities);
}