public function persist(GlobalFunction $function, $packageVersionId)
 {
     $this->insertStmt->bindValue(1, $this->phpType->convertToDatabaseValue($function->getReturnType(), $this->platform));
     $this->insertStmt->bindValue(2, $function->getName());
     $this->insertStmt->bindValue(3, $function->isReturnByRef() ? 1 : 0, \PDO::PARAM_INT);
     $this->insertStmt->bindValue(4, $packageVersionId, \PDO::PARAM_INT);
     $this->insertStmt->bindValue(5, $function->hasVariableParameters() ? 1 : 0, \PDO::PARAM_INT);
     $this->insertStmt->execute();
     $functionId = $this->con->lastInsertId();
     $this->functionIdRef->setValue($function, $functionId);
     foreach ($function->getParameters() as $param) {
         $this->paramPersister->persist($param, $function);
     }
     foreach ($function->getInCallSites() as $callSite) {
         $this->callSitePersister->persist($callSite);
     }
     foreach ($function->getOutCallSites() as $callSite) {
         $this->callSitePersister->persist($callSite);
     }
 }