The override that expects a Component Presentation is just a wrapper for the one that expects the ids. For Instance this override expects a publicationId
, componentId
and componentTemplateId
:
public void remove(int publicationId, int componentId, int componentTemplateId,
ComponentPresentationTypeEnum componentPresentationType)
throws StorageException
{
ComponentPresentation foundComponentPresentation = getComponentPresentation(
publicationId, componentId, componentTemplateId, componentPresentationType);
if(foundComponentPresentation != null)
{
log.debug("Removing component presentation from storage.");
super.remove(foundComponentPresentation);
} else
{
log.debug("Could not find component presentation to remove from storage.");
}
}
This other override expects a ComponentPresentation so that we can call the first override from this one.
public void remove(ComponentPresentation itemToRemove,
ComponentPresentationTypeEnum componentPresentationType)
throws StorageException
{
remove(itemToRemove.getPublicationId(), itemToRemove.getComponentId(),
itemToRemove.getTemplateId(), componentPresentationType);
}
I think it is just for code re-usability since the real implementation is in the first one.