/**
* {@inheritDoc}
*
* Remove the previously persisted document and all its children from the tree
*
* Be aware of the PHPCR tree structure: this removes all nodes with a path under
* the path of this object, even if there are no Parent / Child mappings
* that make the relationship explicit.
*
* @param object $document
*
* @throws InvalidArgumentException if $document is not an object.
*/
public function remove($document)
{
if (!is_object($document)) {
throw new InvalidArgumentException('Parameter $document needs to be an object, ' . gettype($document) . ' given');
}
$this->errorIfClosed();
$this->unitOfWork->scheduleRemove($document);
}