NodeInterface handles entity references inconsistently

Created on 16 October 2013, about 11 years ago
Updated 20 October 2023, about 1 year ago

Problem

$node->type and $node->uid are both entity references - even if the one is a config entity. But the methods in node interface handle both differently, e.g. we have $node->getAuthor() return the user entity and $node->getAuthorId() return the user entity id, while $node->getType() returns the type name, i.e. it's entity id.

Proposal:

  • Make $node->getType() return the config entity and $node->getTypeName() the type name.
  • Use that pattern for all ER
πŸ› Bug report
Status

Closed: won't fix

Version

9.5

Component
EntityΒ  β†’

Last updated about 10 hours ago

Created by

πŸ‡¦πŸ‡ΉAustria fago Vienna

Live updates comments and jobs are added and updated live.
  • API change

    Changes an existing API or subsystem. Not backportable to earlier major versions, unless absolutely required to fix a critical bug.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024