original_string: public function getUpsertedId()
      {
          if ($this->isAcknowledged) {
              foreach ($this->writeResult->getUpsertedIds() as $id) {
                  return $id;
              }
  
              return null;
          }
  
          throw BadMethodCallException::unacknowledgedWriteResultAccess(__METHOD__);
      }
code: public function getUpsertedId()
      {
          if ($this->isAcknowledged) {
              foreach ($this->writeResult->getUpsertedIds() as $id) {
                  return $id;
              }
  
              return null;
          }
  
          throw BadMethodCallException::unacknowledgedWriteResultAccess(__METHOD__);
      }
code_tokens: public function getUpsertedId ( ) { if ( $ this -> isAcknowledged ) { foreach ( $ this -> writeResult -> getUpsertedIds ( ) as $ id ) { return $ id ; } return null ; } throw BadMethodCallException :: unacknowledgedWriteResultAccess ( __METHOD__ ) ; }
docstring: Return the ID of the document inserted by an upsert operation.
  
  If the document had an ID prior to upserting (i.e. the server did not
  need to generate an ID), this will contain its "_id". Any
  server-generated ID will be a MongoDB\BSON\ObjectId instance.
  
  This value is undefined (i.e. null) if an upsert did not take place.
  
  This method should only be called if the write was acknowledged.
  
  @see UpdateResult::isAcknowledged()
  @return mixed|null
  @throws BadMethodCallException is the write result is unacknowledged
docstring_tokens: Return the ID of the document inserted by an upsert operation .