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

namespace \webfiori\framework

class DB

Class Methods Summary

public function __construct(ConnectionInfo|string$connName)Creates new instance of the class.public function addTable(Table$table)Adds a table to the instance.public function register(string$pathToScan)Auto-register database tables which exist on a specific directory.

Class Methods Details

public function __construct(ConnectionInfo|string$connName)Creates new instance of the class.

Parameters:

  • ConnectionInfo|string $connName This can be an object that holds connection information or a string that represents connection name as specified when the connection was added to the file 'Config.php'.
public function addTable(Table$table)Adds a table to the instance.

Parameters:

  • Table $table the table that will be added.
Returns: booleanIf the table is added, the method will return true. False otherwise.
public function register(string$pathToScan)Auto-register database tables which exist on a specific directory. Note that the statement 'return __NAMESPACE__' should be included at the end of the table class for auto-register to work. If the statement does not exist, the method will assume that the path is the namespace of the classes. Also, the classes which represents tables must be suffixed with the word 'Table' (e.g. UsersTable). Also, the registration will depend on the database that the connection is for. For example, if the connection is for MySQL database, then only tables of type 'MySQLTable'.

Parameters:

  • string $pathToScan A path which is relative to application source code. For example, If your application folder name is 'app' and if tables classes exist in the folder 'app\database', then the value of this argument must be 'database'.
mdi-menuAll Classesmdi-chevron-leftAnchorBrCodeSnippetHTMLDocHTMLListHTMLNodeHTMLTableHeadNodeInputJsCodeLabelListItemOrderedListParagraphRadioGroupTableCellTableRowUnorderedListInvalidNodeNameExceptionTemplateNotFoundExceptionCaseConverterJsonJsonConverterJsonIJsonTypesPropertyAPIFilterAbstractWebServiceManagerInfoServiceParamTypesRequestRequestParameterResponseUriWebServicesManagerAccessAutoLoaderConfigConfigControllerDBEAbstractWebServiceExtendedWebServicesManagerFileLoggerPrivilegePrivilegesGroupThemeThemeLoaderUploadFileUploaderUserUtilWebFioriAppLanguageErrorBoxHTTPCodeViewMessageBoxServerErrViewStarterPageWebPageDatabaseSessionStorageDefaultSessionStorageMSSQLSessionDataTableMSSQLSessionsTableMySQLSessionDataTableMySQLSessionsTableSessionSessionOperationsSessionStorageSessionsManagerRouterRouterUriAbstractMiddlewareMiddlewareManagerEmailMessageSMTPAccountSMTPServerClassLoaderExceptionFileExceptionInitializationExceptionInvalidCRONExprExceptionMissingLangExceptionNoSuchThemeExceptionRoutingExceptionSMTPExceptionSessionExceptionUIExceptionAbstractJobCronCronEmailCronJobJobArgumentCronLoginViewCronTasksViewCronViewCronLoginServiceCronLogoutServiceCronServicesManagerForceCronExecutionServiceGetJobsServiceCLICLICommandInputStreamOutputStreamStdInStdOutClassWriterLangClassWriterQueryClassWriterServiceHolderThemeClassWriterWebServiceWriterCreateCLIClassHelperCreateCronJobCreateMiddlewareCreateTableCreateTableObjCreateThemeHelperCreateWebServiceAddCommandCreateCommandCronCommandHelpCommandListCronCommandListRoutesCommandListThemesCommandRunSQLQueryCommandSettingsCommandTestRouteCommandUpdateSettingsCommandUpdateTableCommandVersionCommandAbstractQueryColumnColumnFactoryConditionConnectionConnectionInfoDatabaseDatabaseExceptionDateTimeValidatorEntityMapperExpressionForeignKeyJoinTableResultSetSelectExpressionTableWhereExpressionMySQLColumnMySQLConnectionMySQLQueryMySQLTableMSSQLColumnMSSQLConnectionMSSQLQueryMSSQLTableAbstractCollectionComparableLinkedListNodeQueueStack
Powered By: WebFiori Framework, Vue and VuetifyAll Rights Reserved © 2018 - 2024