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

namespace \webfiori\database

class ResultSet

Class Methods Summary

public function __construct(array$resultArr, callable$mappingFunction, array$mapArgs)Creates new instance of the class.public function clearSet()Reset the values in the set to default values.public function count()Return the number of mapped rows in the set.public function current()Returns the element which exist at current cursor location in the mapped result.public function getMappedRows()Returns the records which was generated after calling the map function.public function getMappedRowsCount()Returns the number of records which was generated after calling the map function.public function getRows()Returns an array which contains all original records in the set before mapping.public function getRowsCount()Return the number of original rows in the set.public function key()Return the key of the current record.public function next()Move forward to next record.public function rewind()Rewind the Iterator to the first record.public function setMappingFunction(Closure$callback, array$otherParams)Sets a custom callback which can be used to process result set and map the records to PHP objects as desired.public function valid()Checks if current position is valid in the iterator.

Class Methods Details

public function __construct(array$resultArr, callable$mappingFunction, array$mapArgs)Creates new instance of the class.

Parameters:

  • array $resultArr An array that holds original result set.
  • callable $mappingFunction A PHP function which is used to modify original result set and shape it as needed. The method can have two arguments, first one is the original data set and the second is an optional array of arguments.
  • array $mapArgs An optional array of arguments to pass on to the mapping function.
public function clearSet()Reset the values in the set to default values. public function count()Return the number of mapped rows in the set. Returns: intIf no result returned by MySQL server, the method will return -1. If the executed query returned 0 rows, the method will return 0. Note that if the mapping function returned other than an array, the method will always return 0.public function current()Returns the element which exist at current cursor location in the mapped result. Returns: mixedNote that if the mapping function did not return an array, the method will always return null.public function getMappedRows()Returns the records which was generated after calling the map function. Returns: mixedThe return value of this method will depend on how the developer implemented the mapping function. By default, the method will return an array that holds fetched records information.public function getMappedRowsCount()Returns the number of records which was generated after calling the map function. The number of records might be less or more based on how the developer have implemented the mapping function. Note that if the mapping function did not return an array, the method will return 1.Returns: intNumber of records after mapping.public function getRows()Returns an array which contains all original records in the set before mapping. Returns: arrayAn array which contains all records in the set.public function getRowsCount()Return the number of original rows in the set. Returns: intNumber of original rows in the set before executing the mapping function.public function key()Return the key of the current record. Returns: int|nullReturns an integer on success, or null on failure.public function next()Move forward to next record. public function rewind()Rewind the Iterator to the first record. public function setMappingFunction(Closure$callback, array$otherParams)Sets a custom callback which can be used to process result set and map the records to PHP objects as desired.

Parameters:

  • Closure $callback A PHP function. The function will have one parameter which is the raw result set as an array.
  • array $otherParams An array that holds extra arguments which can be passed to the mapping function.
Returns: booleanIf the function is set, the method will return true. If not, the method will return false.
public function valid()Checks if current position is valid in the iterator. Returns: booleanReturns true on success or false on failure.
mdi-menuAll Classesmdi-chevron-leftAnchorBrCodeSnippetHTMLDocHTMLListHTMLNodeHTMLTableHeadNodeInputJsCodeLabelListItemOrderedListParagraphRadioGroupTableCellTableRowUnorderedListInvalidNodeNameExceptionTemplateNotFoundExceptionCaseConverterJsonJsonConverterJsonIJsonTypesPropertyAPIFilterAbstractWebServiceManagerInfoServiceParamTypesRequestRequestParameterResponseUriWebServicesManagerAccessAutoLoaderConfigConfigControllerDBEAbstractWebServiceExtendedWebServicesManagerFileLoggerPrivilegePrivilegesGroupThemeThemeLoaderUploadFileUploaderUserUtilWebFioriAppLanguageErrorBoxHTTPCodeViewMessageBoxServerErrViewStarterPageWebPageDatabaseSessionStorageDefaultSessionStorageMSSQLSessionDataTableMSSQLSessionsTableMySQLSessionDataTableMySQLSessionsTableSessionSessionOperationsSessionStorageSessionsManagerRouterRouterUriAbstractMiddlewareMiddlewareManagerEmailMessageSMTPAccountSMTPServerClassLoaderExceptionFileExceptionInitializationExceptionInvalidCRONExprExceptionMissingLangExceptionNoSuchThemeExceptionRoutingExceptionSMTPExceptionSessionExceptionUIExceptionAbstractJobCronCronEmailCronJobJobArgumentCronLoginViewCronTasksViewCronViewCronLoginServiceCronLogoutServiceCronServicesManagerForceCronExecutionServiceGetJobsServiceCLICLICommandInputStreamOutputStreamStdInStdOutClassWriterLangClassWriterQueryClassWriterServiceHolderThemeClassWriterWebServiceWriterCreateCLIClassHelperCreateCronJobCreateMiddlewareCreateTableCreateTableObjCreateThemeHelperCreateWebServiceAddCommandCreateCommandCronCommandHelpCommandListCronCommandListRoutesCommandListThemesCommandRunSQLQueryCommandSettingsCommandTestRouteCommandUpdateSettingsCommandUpdateTableCommandVersionCommandAbstractQueryColumnColumnFactoryConditionConnectionConnectionInfoDatabaseDatabaseExceptionDateTimeValidatorEntityMapperExpressionForeignKeyJoinTableResultSetSelectExpressionTableWhereExpressionMySQLColumnMySQLConnectionMySQLQueryMySQLTableMSSQLColumnMSSQLConnectionMSSQLQueryMSSQLTableAbstractCollectionComparableLinkedListNodeQueueStack
Powered By: WebFiori Framework, Vue and VuetifyAll Rights Reserved © 2018 - 2024