public function persist(Parameter $param, AbstractFunction $function) { switch (true) { case $function instanceof GlobalFunction: $stmt = $this->fStmt; break; case $function instanceof Method: $stmt = $this->mStmt; break; default: throw new \InvalidArgumentException('Unsupported AbstractFunction implementation ' . get_class($function)); } $stmt->bindValue(1, $function->getId(), \PDO::PARAM_INT); $stmt->bindValue(2, $param->getName()); $stmt->bindValue(3, $this->phpType->convertToDatabaseValue($param->getPhpType(), $this->platform)); $stmt->bindValue(4, $param->getIndex(), \PDO::PARAM_INT); $stmt->bindValue(5, $param->isPassedByRef() ? 1 : 0, \PDO::PARAM_INT); $stmt->bindValue(6, $param->isOptional() ? 1 : 0, \PDO::PARAM_INT); $stmt->execute(); }