Версия:
Other get methods
In the base class, in addition to the main get method, a series of specialized methods for retrieving data are implemented to simplify typical tasks.
getById
A simplified method for retrieving a record by its unique identifier (id).
- Features:
- Unlike the basic
get, it does not acceptwhereandparam_whereparameters. Instead, theidis passed directly. - It accepts
columnsand other parameters that are applicable and meaningful for a point request. - Error Handling: If a record with the specified
idis not found, the method throws a “Record not found” error. In contrast to thegetmethod, where if no records are found according to the passed conditions, it is NOT an error.
- Unlike the basic
- Response Format:
- The found record is located in
res.data.rows[0]. - In the latest core versions, the record is also duplicated in the
res.data.rowproperty for more convenient access.
- The found record is located in
getCount
A method for getting the total number of records that satisfy given conditions.
- Mechanics: Internally calls the standard
getmethod with thecountOnly=trueparameter set. - Result: The number of records is returned in the
res.data.countfield.
getForSelect
A specialized method used for forming data for drop-down lists (select).
- Detailed description is missing in the current version of the documentation.
getForFilterSelect
A method used for forming selection lists in filters of client components.
- Detailed description is missing in the current version of the documentation.
search
A method for performing a quick search by a string value.
- Mechanics: Receives a search string and automatically inserts it into the
wherecondition (with preliminary escaping) for each field marked in the class profile asquick_search_field.
getMass
Deprecated. This method is no longer recommended for use.
export_to_excel
A method for exporting data to Excel format.
- Features: Generates an Excel file with the same column settings and data filtering as in the client table from which the call was initiated.
export_to_json
A method for exporting data to JSON format.
- Features: Generates a JSON file based on the current settings and data of the client table.