Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Comment | File | Size | Author |
---|---|---|---|
#40 | node-interface-methods-2015123-40.patch | 34.72 KB | Berdir |
#33 | node-interface-methods-2015123-33.patch | 34.95 KB | Berdir |
#33 | node-interface-methods-2015123-33-interdiff.txt | 570 bytes | Berdir |
#31 | node-interface-methods-2015123-31.patch | 34.95 KB | Berdir |
#31 | node-interface-methods-2015123-31-interdiff.txt | 8.17 KB | Berdir |
Comments
Comment #1
tim.plunkettSomething like this.
Comment #3
tim.plunkettTagging
Comment #4
BerdirMaybe leave this out because I really hope this will become a configurable field.
For FileInterface, we chose getOwner() that returns the loaded user entity. How many use cases do we have that just want the uid and loading the user would be an overhead? Then maye have getOwner() (author?) and getOwnerId()?
In FileInterface, I also added methods to change the status, could be publish() here.
Comment #5
BerdirRe-adding tags.
This is what I wanted to do for #1939994: Complete conversion of nodes to the new Entity Field API because it means we can convert all these so that it does no longer matter if we're working with an BC Decorator or not. Then we can convert to methods and only have to deal with the configurable fields (of which there's still going to be a ton, but..) when finally removing it.
Comment #6
xjmComment #7
BerdirContinuing a bit with this, added getAuthor() and getAuthorId() instead of getUid(), getCreatedTime() and getChangedTime(), removed the fake public properties, fixed some bugs in the conversions.
Also had some merge conflicts, so no useful interdiff.
Comment #9
BerdirThat should fix (most?) of those errors, also removed getComment as suggested above, we can still add it back.
Comment #11
BerdirRe-roll.
Comment #13
BerdirMerge resulted in two getBCEntity() methods.
Comment #15
BerdirWeeeeird.
Comment #16
twistor CreditAttribution: twistor commentedCan we move the getAuthor() and getAuthorID() methods to an EntityAuthorInterface? Then Comment could implement it as well as contrib entities.
I'd be happy to do it in a followup.
Comment #17
BerdirI'm not sure about splitting interfaces up too much, I think it makes it harder to understand what methods are available when looking at documentation (IDE's don't have a problem with it except you don't have the node specific methods bold anymore).
Let's also add setter methods and then get this in and continue to convert to the interface in #1939994: Complete conversion of nodes to the new Entity Field API.
Comment #18
BerdirOk, added some setter methods, not sure about some names. publish/unpublish works, stick/unstick and promote/unpromote not as much. Should we go for setSticky(TRUE/FALSE) there?
Comment #20
Berdir#18: node-interface-methods-2015123-18.patch queued for re-testing.
Comment #21
Crell CreditAttribution: Crell commentedPossible scope creep: NODE_PROMOTED should really be NodeInterface::PROMOTED. Same for the other constants here.
(Feel free to ignore for scope reasons, but it should be a follow up if possible.)
setSticky(TRUE/FALSE) definitely works better for me. I'd be fine with setPublished(TRUE/FALSE) as well if it makes sense for consistency.
Comment #22
BerdirI'd like to postpone the constant changes. Because we use those methods as much as possible, most usages of them should go away, except probably queries. There might also be a discussion whether they should be on NodeInterface or Node.
Changed to setSticky(), setPromoted() and setPublished(), like the consistency argument.
Comment #24
XanoTypo: authRor
Comment #25
BerdirThanks, fixed that and also converted a few additional calls.
Comment #27
BerdirHm, BC fun. Let's see if this works better.
Comment #29
BerdirAdded special handling for uid 0. Maybe the entityreference field should be improved instead. It doesn't seem to try to load the uid 0.
Comment #30
XanoI did a manual review and apart from a few overly verbose @param and @return descriptions, the only things I found were three properties that have been removed, but do not seem to get equivalent methods in return, or have them already.
There is no equivalent.
There is no equivalent for this.
There is no equivalent for this.
Comment #31
BerdirAdded methods for the revision stuff, leaving translation set ID out for now, that does not belong in here IMHO, translation.module stuff.
Also made the setters support fluent calls.
Comment #33
BerdirFixing stupid typos. Making lots of them today.
Comment #35
Berdir#33: node-interface-methods-2015123-33.patch queued for re-testing.
Comment #37
Berdir#33: node-interface-methods-2015123-33.patch queued for re-testing.
Comment #38
tim.plunkettThis is awesome, especially the fluent methods.
Comment #39
alexpottNeeds a reroll
Comment #40
BerdirRe-rolled.
Comment #41
plachGreen, back to RTBC.
Comment #42
alexpottCommitted 083ee68 and pushed to 8.x. Thanks!
Comment #43
BerdirAdded this issue to https://drupal.org/node/1806650, which already describes that interfaces have been added and links to the Node interface.
Comment #44.0
(not verified) CreditAttribution: commentedsimplify summary, the summary of the meta should be enough.