Benefit of processing multiple entities at once?


buildMultiple() exists, but it was done before we introduced render caching to entities and with that, lazy entity rendering/building. Now we don't really need multiple processing.

See for a discussion about that and the conclusion that we don't really need buildMultiple() anymore.

The idea is that if we render a page with 20 articles, then rendering them all separately is slightly slower on the first request. However, if you save one of those articles, or create a new one, then when accessing that page again, only one needs to be rendered (again), the others can be returned from the cache.

Whether or not a multiple API makes sense for you depends on how it will be called, if you expect it to be called on multiple entities, then can make sense, if not, then probably not.

Tags: Drupal 8 / Entities

Similar questions

Creating two entities at once using entity metadata wrappers
I'm currently facing a situation where I need to create a new instance of a certain entity and attach a file to it. Since the main entity should 'reference' the file (the same way a node references a user, by an entity property) there are several things I can do. Since both methods would require me to perform 3 operations in a row I thought it migh...
Attaching Entities to other Entities
I have two custom entities in a D7 site. One is 'additional' data on an entity, and I want to attach that data to the main entity every time it is loaded. Within Entity/Entity API, how can I do that correctly? attachLoad sounded correct but seems to be Field related, all my data are not fields (yet).
Using "Model Entities" Module to Create Custom Entities
Model Entities: I've been trying to use this contrib module to create my own entity (the "client" entity). Steps I've undertaken: So far debugging has gotten me this far: So I suspected it's something to do with the custom "views" that the module is implementing. And indeed, it did not register the custom view proper...
Add referencing entities into this entities renderable array
Lets say I have a taxonomy called bands, and a taxonomy called band_members. Band_members have an entity reference field relating each band member to a band. When I view the bands taxonomy term page the band_members will not be listed. I can modify the taxonomy term template and manually add them in there, however the bands need to be shown in popu...
How are Field API fields transfered from config entities to content entities?
So I am creating a content and config entities - exactly like node and node type. After I've created them I've noticed that I can add fields to the config entities, which is ok but then I've realised that I'm working with two separate entity types, so I wonder how re Field API fields "transferred" from the config entity to the content entity?
Remote entities versus local entities for third party integration
While integrating any third party tool with its own data storage capabilities, I usually end up with a question So far I could figure out following Pros and Cons in both the cases. PROS for storing on Drupal(local entities): CONS for storing on Drupal(local entites): Another possible option could be storing at both places Drupal and third party too...

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.