Problem/Motivation
Forgot to create a follow-up from #2648802: Deleting a choice should delete the votes over it in the database (?) (see #6).
lets do a follow-up to move all vote related methods from PollStorage to this new service.
Proposed resolution
- move these methods from PollStorage to PollVoteStorage
- update the affected classes
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | move_vote_methods_to_service-2682423-4.patch | 15.64 KB | tduong |
| #4 | interdiff-2682423-2-4.txt | 9.99 KB | tduong |
Comments
Comment #2
tduong commentedMoved the methods, updated affected Interfaces and classes, + small refactorings.
Comment #3
berdirYou should update the variable name. it's no longer a storage_controller. Just $vote_storage.
Poll has a beta release. That means we should not change the API like this, it might break custom and other contrib modules.
So what we have to do is add a @deprecated text, see examples in core and say that this was deprecated in 8.x-1.0 and XYZ should be used instead. Then also keep the old implementations and call the new methods instead.
this is not an entity storage. Don't extend from that.
same here. we just have our own methods, nothing else.
Comment #4
tduong commentedFixed based on comment above.
Comment #5
berdirdouble space here, lets fix it while we touch the code.
Comment #6
berdirI'll fix that on commit.
Comment #7
berdirThank you.