Page MenuHomePhabricator

Add a method to remove statements
Closed, DeclinedPublic

Description

"(...) My first idea was to mirror the existing StatementList::addStatement( Statement $statement ) and introduce StatementList::removeStatement( Statement $statement ). But that's not very helpful. This method is barely used. In tests we use addNewStatement. How to remove such statements?

More convenience methods in Item? Probably not a good idea.

How to empty a StatementList? Item::setStatements( new StatementList() ) is possible but a bit ugly. Should there be a StatementList::clear()?"

https://github.com/wmde/WikibaseDataModel/issues/175

Event Timeline

Lucie raised the priority of this task from to Needs Triage.
Lucie updated the task description. (Show Details)
Lucie changed Security from none to None.
Lucie subscribed.

Most simple idea to partly fix this is to add support for setStatements( null ), but I'm not 100% sure about this idea because this can be misread and be confusing, see https://github.com/wmde/WikibaseDataModel/pull/293.

thiemowmde claimed this task.