WebFioriAPI ReferenceLearnDownloadContributeLearn{{result.parent_page}} > {{result.title}}{{result.title}}Classes{{result.class_name}}{{result.summary}}Methods{{result.name}}{{result.summary}}

namespace \webfiori\database

class ConnectionInfo

Class Attributes Summary

const SUPPORTED_DATABASESAn array that contains supported database drivers.

Class Methods Summary

public function __construct(string$databaseType, string$user, string$pass, string$dbname, string$host, int$port, array$extras)Creates new instance of the class.public function getDBName()Returns the name of the database.public function getDatabaseType()Returns the type of the database at which the connection will use.public function getExtars()Returns an array that contains any extra connection information.public function getHost()Returns the address of database host.public function getName()Returns the name of the connection.public function getPassword()Returns the password of the user that will be used to access the database.public function getPort()Returns database server port number.public function getUsername()Returns username of the user that will be used to access the database.public function setDBName(string$name)Sets the name of the database.public function setDatabaseType(string$type)Sets the type of the database.public function setExtras(array$array)Sets extra connection information as an array.public function setHost(string$hostAddr)Sets the address of database host.public function setName(string$newName)Sets the name of the connection.public function setPassword(string$password)Sets the password of the user that will be used to access the database.public function setPort(int$portNum)Sets database server port number.public function setUsername(string$user)Sets the username of the user that will be used to access the database.

Class Attributes Details

const SUPPORTED_DATABASESAn array that contains supported database drivers. The array has the following values:
  • mysql
  • mssql

    Class Methods Details

    public function __construct(string$databaseType, string$user, string$pass, string$dbname, string$host, int$port, array$extras)Creates new instance of the class.

    Parameters:

    • string $databaseType Name of the database at which the connection is for. Can be 'mysql' or 'mssql'.
    • string $user The username of the user that will be used to access the database.
    • string $pass The password of the user.
    • string $dbname The name of the database.
    • string $host The address of database host or server name.
    • int $port Port number that will be used to access database server. In case of 'mysql', default is 3306. In case of 'mssql', default is 1433.
    • array $extras An array that can have extra information at which the connection might need.
    public function getDBName()Returns the name of the database. Returns: stringA string that represents the name of the database.public function getDatabaseType()Returns the type of the database at which the connection will use. Returns: stringDatabase type such as 'mysql' or 'maria-db'.public function getExtars()Returns an array that contains any extra connection information. Returns: arrayAn array that contains any extra connection information.public function getHost()Returns the address of database host. The host address can be a URL, an IP address or 'localhost' if the database is hosted in the same server that the framework is installed in.Returns: stringA string that represents the address of the host. If it is not set, the method will return 'localhost' by default.public function getName()Returns the name of the connection. Returns: stringThe name of the connection. Default return value is 'New_Connection'.public function getPassword()Returns the password of the user that will be used to access the database. Returns: stringA string that represents the password of the user.public function getPort()Returns database server port number. Returns: intServer port number. If it is not set, the method will return 3306 by default.public function getUsername()Returns username of the user that will be used to access the database. Returns: stringA string that represents the username.public function setDBName(string$name)Sets the name of the database.

    Parameters:

    • string $name The name of the database.
    public function setDatabaseType(string$type)
    Sets the type of the database. The value is used to select the correct query builder for the database. Supported values are:
    • mysql

    Parameters:

    • string $type Database type such as 'mysql' or 'maria-db'.
    Returns: booleanIf the type is set, the method will return true. Other than that, the method will return false.
    public function setExtras(array$array)Sets extra connection information as an array. The array should contain any extra information at which the connection might use.

    Parameters:

    • array $array An array that contains any extra connection information.
    public function setHost(string$hostAddr)Sets the address of database host. The host address can be a URL, an IP address or 'localhost' if the database is hosted in the same server that the framework is installed in.

    Parameters:

    • string $hostAddr The address of database host.
    public function setName(string$newName)Sets the name of the connection.

    Parameters:

    • string $newName The new name. Must be non-empty string.
    public function setPassword(string$password)Sets the password of the user that will be used to access the database.

    Parameters:

    • string $password A string that represents the password of the user.
    public function setPort(int$portNum)Sets database server port number.

    Parameters:

    • int $portNum Server port number. It will be set only if the given value is greater than 0.
    public function setUsername(string$user)Sets the username of the user that will be used to access the database.

    Parameters:

    • string $user A string that represents the username.
    mdi-menuAll Classesmdi-chevron-leftAnchorBrCodeSnippetHTMLDocHTMLListHTMLNodeHTMLTableHeadNodeInputJsCodeLabelListItemOrderedListParagraphRadioGroupTableCellTableRowUnorderedListInvalidNodeNameExceptionTemplateNotFoundExceptionCaseConverterJsonJsonConverterJsonIJsonTypesPropertyAPIFilterAbstractWebServiceManagerInfoServiceParamTypesRequestRequestParameterResponseUriWebServicesManagerAccessAutoLoaderConfigConfigControllerDBEAbstractWebServiceExtendedWebServicesManagerFileLoggerPrivilegePrivilegesGroupThemeThemeLoaderUploadFileUploaderUserUtilWebFioriAppLanguageErrorBoxHTTPCodeViewMessageBoxServerErrViewStarterPageWebPageDatabaseSessionStorageDefaultSessionStorageMSSQLSessionDataTableMSSQLSessionsTableMySQLSessionDataTableMySQLSessionsTableSessionSessionOperationsSessionStorageSessionsManagerRouterRouterUriAbstractMiddlewareMiddlewareManagerEmailMessageSMTPAccountSMTPServerClassLoaderExceptionFileExceptionInitializationExceptionInvalidCRONExprExceptionMissingLangExceptionNoSuchThemeExceptionRoutingExceptionSMTPExceptionSessionExceptionUIExceptionAbstractJobCronCronEmailCronJobJobArgumentCronLoginViewCronTasksViewCronViewCronLoginServiceCronLogoutServiceCronServicesManagerForceCronExecutionServiceGetJobsServiceCLICLICommandInputStreamOutputStreamStdInStdOutClassWriterLangClassWriterQueryClassWriterServiceHolderThemeClassWriterWebServiceWriterCreateCLIClassHelperCreateCronJobCreateMiddlewareCreateTableCreateTableObjCreateThemeHelperCreateWebServiceAddCommandCreateCommandCronCommandHelpCommandListCronCommandListRoutesCommandListThemesCommandRunSQLQueryCommandSettingsCommandTestRouteCommandUpdateSettingsCommandUpdateTableCommandVersionCommandAbstractQueryColumnColumnFactoryConditionConnectionConnectionInfoDatabaseDatabaseExceptionDateTimeValidatorEntityMapperExpressionForeignKeyJoinTableResultSetSelectExpressionTableWhereExpressionMySQLColumnMySQLConnectionMySQLQueryMySQLTableMSSQLColumnMSSQLConnectionMSSQLQueryMSSQLTableAbstractCollectionComparableLinkedListNodeQueueStack
    Powered By: WebFiori Framework, Vue and VuetifyAll Rights Reserved © 2018 - 2024