This is a meta issue for completing and improving the entity API for Drupal 8.

Goals

  • Complete the API (i.e. implement full CRUD)
  • Improve DX (classed objects, ..)
  • Full support for diverse storage engines, remote storage per entity-type.

..?

Roadmap

Step 1: The base: CRUD, classed objects based upon a defined interface

Step 2: Convert all entity types to classed objects:

Once the above issues are complete:

Step 3: Multiple controllers/decoupling: Lay the foundation for adding more entity-based functionality.

Step 4: Add further APIs around entities

Misc, but major issues without any particular order:

General sandbox:
http://drupal.org/sandbox/fago/1497344

Let’s use this issue for high-level architecture discussion and update the roadmap accordingly.
Thoughts?

Comments

fago’s picture

Issue summary: View changes

Updated issue summary.

fago’s picture

Issue summary: View changes

Updated issue summary.

fago’s picture

Issue summary: View changes

Updated issue summary.

fago’s picture

Issue summary: View changes

Updated issue summary.

Gábor Hojtsy’s picture

Looks superb. Tagging DX and D8MI.

Gábor Hojtsy’s picture

Issue summary: View changes

Updated issue summary.

gdd’s picture

Issue tags: +Configuration system

Also tagging cmi. Looks great.

gdd’s picture

Another thing we will want to look at is how we're going to introduce UUIDs into entities. I will probably make a new issue for that as well. I think it makes sense for this to happen after all the entities are converted maybe?

xjm’s picture

From #1184944-151: Make entities classed objects, introduce CRUD support:

While we're waiting ;) it'd be great to open the follow-up issues for this and document them in the issue summary, I can think of the following but might have missed some too:

- converting all the different core entities apart from Comment.
- adding revision support to the base controller (which will need co-ordination with #1082292: Clean up/refactor revisions)

I don't see revision support explicitly listed above. I'm assuming it would be an additional item in step 1, before we start on the other entities?

tstoeckler’s picture

Implement full revision support in the database storage controller

You're right, though, we need that to convert nodes.

andypost’s picture

when re-factoring revisions take a look at #218755: Support revisions in different states
It's not much different from #1082292: Clean up/refactor revisions

andypost’s picture

Issue summary: View changes

(xjm) Added @todos from #1184944 and added header tags.

xjm’s picture

Alright, I moved the note about revision support up to Step 1.

fago’s picture

We don't necessarily need proper revision support for being able to port nodes over, as we can just move the revision specific stuff into the controller. That way, we could focus on porting everything over first and then get revisions right.

fago’s picture

Issue summary: View changes

Updated issue summary.

fago’s picture

Issue summary: View changes

Updated issue summary.

fago’s picture

xjm’s picture

webchick’s picture

I'd love to see those follow-up issues classified as major "feature requests" rather than tasks. It's not really very equitable to the rest of the team for a single initiative to block progress on all other initiatives by pushing us up over thresholds by splitting up the work into sub-issues.

Totally cool with this issue remaining a major task, though.

xjm’s picture

Ah, yes, +1 for switching them to feature requests. They are kind of bullying major tasks at the moment. :) I've switched them to feature requests for now, unless someone disagrees?

catch’s picture

I'm fine with downgrading the individual issues from major task, but think we should open a single critical issue (not this one which is about further API additions/changes) to track them.

Converting existing entities to the new API is essential to uncover issues with what we just committed (as we found out at length with field API), and needs to happen earlier rather than later in the cycle (and it's critical to update all core entities before we get to release, so critical feels about right for that).

Gábor Hojtsy’s picture

Well, if we want to make real use of the OO API (introducing language consistently as well as adding UUID support), we should do the conversion sooner than later. So I hope it is not just done later up to the release :) Or if the OO conversion is to be delayed, we should add UUID and language with the old methods and the conversion will be just more work that way. Not sure its better in that direction.

catch’s picture

Yeah I couldn't agree more, opened #1368394: Convert all core entities to classed objects.

aspilicious’s picture

sun’s picture

Issue tags: +Entity system
sun’s picture

Issue summary: View changes

Added issue

yched’s picture

yched’s picture

fago’s picture

Dave Reid’s picture

It would be very nice if we could actually keep entity_label() around. It works very well as a title callback for menu router items.

fubhy’s picture

Actually, I would like to keep entity_uri as well for similar reasons.

fubhy’s picture

Issue summary: View changes

added 1391694

fago’s picture

I've added #1301106: Rely on methods to access entity properties [policy, no patch] to the summary.

It would be very nice if we could actually keep entity_label() around. It works very well as a title callback for menu router items.

Indeed, that could be used for term and node view pages. However, I'd still prefer renaming it to make clear people should use $entity->label() now. E.g. we could have entity_page_title() analogously to node_page_title(), which just calls $entity->label().

@entity-uri: I'm not aware of any use-case for that, but if there is one I'd suggest doing the same as for the label. Add a function that's clear purpose is being a callback.

catch’s picture

I've added #1346204: [META] Drupal 8 Entity API improvements to the summary.

That's recursive ;) Not that I can talk, I've marked dozens of issues duplicate of themselves...

fago’s picture

Well, GNU is my inspiration :D Fixed it.

Gábor Hojtsy’s picture

Issue tags: -D8MI +D8MI-meta

Move to new D8MI-meta tag.

Dries’s picture

Issue tags: +Favorite-of-Dries

Tagging.

monil-dupe’s picture

Issue summary: View changes

Updated issue summary.

fago’s picture

Issue summary: View changes

Updated issue summary.

fago’s picture

Issue summary: View changes

Updated issue summary.

fago’s picture

Also see the related discussion over at #1497374: Switch from Field-based storage to Entity-based storage
I'ved added a pointer to that issue + the according sandbox to the summary.

xjm’s picture

Couple followups from the user conversion:
#1537434: Add type-hinting to user entities
#1537442: Rename $user->access and $user->login

Edit: I didn't know where to put these on the roadmap in the summary. :)

aspilicious’s picture

Do we have to make an issue to convert

"field_test_create_stub_entity"

At the moment it returns a stdObject but this is incorrect. It should return a proper entity.
That also blocks some followups like remove entity_label().

Problem: it sometimes adds a version ID which is only possible for nodes.

plach’s picture

First stab to the Entity form system in #1499596: Introduce a basic entity form controller. Early reviews welcome :)

plach’s picture

Issue summary: View changes

Updated issue summary.

Berdir’s picture

Berdir’s picture

Issue summary: View changes

Updated issue summary.

Berdir’s picture

Issue summary: View changes

Updated issue summary.

catch’s picture

Issue summary: View changes

Updated issue summary.

catch’s picture

Issue summary: View changes

Updated issue summary.

plach’s picture

Issue summary: View changes

Added the first issue on the entiy form system.

catch’s picture

Issue summary: View changes

Updated issue summary.

catch’s picture

Issue summary: View changes

Updated issue summary.

sun’s picture

Title: [META] Drupal 8 Entity API improvements » [meta] Drupal 8 Entity API improvements
Category: task » feature
sun’s picture

Issue summary: View changes

referenced the entity_uri issue

steveoliver’s picture

Issue summary: View changes

typo

Berdir’s picture

Status: Active » Fixed

We achieved almost everything of this, yay! Now we need to complete it, there's a new meta for this, see you over in #2095603: [meta] Complete Entity Field API.

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Updated issue summary