original_string: public function remove($document)
      {
          if (!is_object($document)) {
              throw new \InvalidArgumentException(gettype($document));
          }
          $this->errorIfClosed();
          $this->unitOfWork->remove($document);
      }
code: public function remove($document)
      {
          if (!is_object($document)) {
              throw new \InvalidArgumentException(gettype($document));
          }
          $this->errorIfClosed();
          $this->unitOfWork->remove($document);
      }
code_tokens: public function remove ( $ document ) { if ( ! is_object ( $ document ) ) { throw new \ InvalidArgumentException ( gettype ( $ document ) ) ; } $ this -> errorIfClosed ( ) ; $ this -> unitOfWork -> remove ( $ document ) ; }
docstring: Removes a document instance.
  
  A removed document will be removed from the database at or before transaction commit
  or as a result of the flush operation.
  
  @param object $document The document instance to remove.
  
  @throws \InvalidArgumentException when the $document param is not an object
docstring_tokens: Removes a document instance .