public function remove($document)
{
if (!is_object($document)) {
throw new \InvalidArgumentException(gettype($document));
}
$this->errorIfClosed();
$this->unitOfWork->remove($document);
}
/** * @param Item $item * @param string|null $collection * @return Item */ public function delete($item, $collection = null) { $this->setCollection($collection); $this->dm->remove($item); $this->dm->flush(); return $item; }