Updated: Comment #N

Problem/Motivation

Originally, the method to get the property values of a ConfigEntity was called getProperties(), and lived on the storage controller.
In #1849480: Allow ConfigEntity classes to control how they are saved it was moved to the entity class itself, but also renamed to getExportProperties().

But yet this is not just useful for export. It can be used whenever the array-based representation of an entity is needed, like in entity normalization.
#2002138: Use an adapter for supporting typed data on ContentEntities also is renaming ContentEntityInterface::getPropertyValues() to toArray() as well, and this can eventually be moved to EntityInterface itself.

Proposed resolution

Rename getExportProperties() to toArray()

Remaining tasks

If #2002138: Use an adapter for supporting typed data on ContentEntities lands before this, also move the method up to EntityInterface

User interface changes

N/A

API changes

ConfigEntityInterface::getExportProperties() is renamed to toArray()

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tim.plunkett’s picture

Status: Active » Needs review
FileSize
19.31 KB
socketwench’s picture

Yes, please! toArray() makes a lot more intuitive sense than getExportProperties(). The former is similar to common class methods like toString() and a familiar pattern in other OOP languages.

msonnabaum’s picture

Status: Needs review » Reviewed & tested by the community

Looks great. Much clearer.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 1: config-toarray-2219925-1.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
19.27 KB

git apply --3way took care of it.

webchick’s picture

Status: Reviewed & tested by the community » Needs work

Sorry, this no longer applies. I can get it in right after a re-roll tho.

tim.plunkett’s picture

Status: Needs work » Needs review
FileSize
19.06 KB

The class just was moved in #2221929: ConfigNormalizerTest.php is misnamed, easy reroll.

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Sending back to rtbc

webchick’s picture

Status: Reviewed & tested by the community » Fixed

There we go!

Committed and pushed to 8.x. Thanks!

  • Commit 2390276 on 8.x by webchick:
    Issue #2219925 by tim.plunkett: Rename ConfigEntityInterface::...
tim.plunkett’s picture

Assigned: tim.plunkett » Unassigned

Thanks!

Status: Fixed » Closed (fixed)

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