original_string: public function contains($document)
      {
          if (!is_object($document)) {
              throw new \InvalidArgumentException(gettype($document));
          }
  
          return $this->unitOfWork->isScheduledForInsert($document) ||
              $this->unitOfWork->isInIdentityMap($document) &&
              !$this->unitOfWork->isScheduledForDelete($document);
      }
code: public function contains($document)
      {
          if (!is_object($document)) {
              throw new \InvalidArgumentException(gettype($document));
          }
  
          return $this->unitOfWork->isScheduledForInsert($document) ||
              $this->unitOfWork->isInIdentityMap($document) &&
              !$this->unitOfWork->isScheduledForDelete($document);
      }
code_tokens: public function contains ( $ document ) { if ( ! is_object ( $ document ) ) { throw new \ InvalidArgumentException ( gettype ( $ document ) ) ; } return $ this -> unitOfWork -> isScheduledForInsert ( $ document ) || $ this -> unitOfWork -> isInIdentityMap ( $ document ) && ! $ this -> unitOfWork -> isScheduledForDelete ( $ document ) ; }
docstring: Determines whether a document instance is managed in this DocumentManager.
  
  @param object $document
  
  @throws \InvalidArgumentException When the $document param is not an object
  @return bool TRUE if this DocumentManager currently manages the given document, FALSE otherwise.
docstring_tokens: Determines whether a document instance is managed in this DocumentManager .