original_string: public function getLastInsertID() {
  		if (count($this->rows) > 0) {
  			$end = end($this->rows);
  			if ($end->toRow() && $end->toRow()->getPrimary()) {
  				return (int) $end->toRow()->getPrimary();
  			} else if ($end->toRow() === NULL) {
  				return NULL;
  			} else {
  				throw new RepositoryException("Table \"" . self::TABLE . "\" does not have a primary key.");
  			}
  		} else {
  			return NULL;
  		}
  	}
code: public function getLastInsertID() {
  		if (count($this->rows) > 0) {
  			$end = end($this->rows);
  			if ($end->toRow() && $end->toRow()->getPrimary()) {
  				return (int) $end->toRow()->getPrimary();
  			} else if ($end->toRow() === NULL) {
  				return NULL;
  			} else {
  				throw new RepositoryException("Table \"" . self::TABLE . "\" does not have a primary key.");
  			}
  		} else {
  			return NULL;
  		}
  	}
code_tokens: public function getLastInsertID ( ) { if ( count ( $ this -> rows ) > 0 ) { $ end = end ( $ this -> rows ) ; if ( $ end -> toRow ( ) && $ end -> toRow ( ) -> getPrimary ( ) ) { return ( int ) $ end -> toRow ( ) -> getPrimary ( ) ; } else if ( $ end -> toRow ( ) === NULL ) { return NULL ; } else { throw new RepositoryException ( "Table \"" . self :: TABLE . "\" does not have a primary key." ) ; } } else { return NULL ; } }
docstring: Return last insert ID
  
  @return int|null
  @throws RepositoryException
docstring_tokens: Return last insert ID