Instead of deprecating and removing all usages of Entity::isEmpty, Entity::copy and Entity::clear, we should discuss if we want to add all or some of them to the EntityDocument interface.
|· · ·|
|Declined||Bene||T98290 [Task] Remove deprecated methods from Entity and subtypes|
|Resolved||Bene||T104895 [Story] Stop using deprecated methods of Entity|
|Resolved||daniel||T110177 [RFC] Add methods to EntityDocument|
|Resolved||Bene||T109581 Figure out what to do with Entity::isEmpty|
|· · ·|
I think it makes sense at least for isEmpty to add it to the interface. copy may not be in the interface, but should still be available in the implementations (Item, Property). clear is used only once in the api in wbeditentity, where one can set clear=true to clear the whole entity and add new data to it. This is currently used by the Wikidata Tours to provide a clean Item page.
Entity::clear seems a bit silly, we might as well create a new Entity objects. But isEmpty() and copy() seem quite useful - conceptually they appyl to any entity, and should be implemented for all kinds of entities, so they should be part of the interface.
- clear should just die. If you need a new entity, create a new one. Never ever repurpose an existing one to be something else.
- copy can be and is useful, but I'm not sure if it needs to be in an interface. Having it in the implementations is fine in my opinion.
- isEmpty should be in the interface, in my opinion.