Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295855

Improve documentation of EntityStorageInterface create funtion

$
0
0

Problem/Motivation

In the documentation for EntityStorageBase::create it is written:
array $values: (optional) An array of values to set, keyed by property name. If the entity type has bundles, the bundle key has to be specified.

However there is no guidance on how to set the bundle key.

https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21EntityStorageBase.php/function/EntityStorageBase%3A%3Acreate/9.1.x#comment-65782

Steps to reproduce

Proposed resolution

To set the bundle key, it seems like you have to use the 'type' key in the array. This should be specified to make the documentation less ambiguous.

Remaining tasks

Review patch / give feedback

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet


Viewing all articles
Browse latest Browse all 295855

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>