Grid_Ctrl __construct(
string
$system_name, Vars_Manager
$vm, [integer
$method = Tangra_Parameter_Method::GET]
)
|
|
Constructor
Parameters:
|
string |
$system_name: |
|
|
Vars_Manager |
$vm: |
Permanent Vars_Manager that will be used. Session of Thread VM |
|
integer |
$method: |
Tangra_Parameter_Method::GET or Tangra_Parameter_Method::POST or Tangra_Parameter_Method::PI |
void add_additional_parameter(
string
$name, mixed
$value
)
|
|
Adds new additional parameter
Please note that this parameter will be also added to grid's external parameters.
Parameters:
|
string |
$name: |
|
|
mixed |
$value: |
|
API Tags:
Information Tags:
| Throws: | TE_Key_Already_Exists |
Overoload this method, create your Grid object and return it
API Tags:
| Abstract: | |
| Access: | protected |
void create_paginate_db_data(
)
|
|
Overload this method, create Paginate_DB_Data and return it
API Tags:
| Abstract: | |
| Access: | protected |
integer detect_page(
integer
$page
)
|
|
Detects current page number.
Will return current page number. If $page is passed - will return that value otherwise will retrieve current page from permanent VM.
Parameters:
API Tags:
void get_additional_parameter(
string
$name, [boolean
$forgiving = false]
)
|
|
Returns value ot additional parameter
Parameters:
|
string |
$name: |
|
|
boolean |
$forgiving: |
|
API Tags:
Information Tags:
| Throws: | TE_Key_Not_Exists |
array get_additional_parameters(
)
|
|
Returns all additional parameters as array
API Tags:
| Return: | Simple array, key => value pairs |
| Access: | public |
Returns reference to grid object
API Tags:
Web_Event_Si get_grid_set_page_event(
)
|
|
Returns web event for set page command
API Tags:
Returns method for receiving commands
API Tags:
Returns reference to Paginate_DB_Data object
API Tags:
unknown get_system_name(
)
|
|
Returns grid's system name
API Tags:
TPLE_Exports get_tple_exports(
)
|
|
Get TPLE Exports for the grid
API Tags:
string get_user_defined_post_processing_method(
)
|
|
Returns name of the user defined method that will be called for postprocessing of the rows
API Tags:
Returns reference to Vars_Manager object
API Tags:
| Internal: | |
| Access: | protected |
Initializes the object
API Tags:
Have to be overwriten and sqls for the Paginate_DB_Data have to be set inside.
API Tags:
Process the grid
This method will load page passed with $page or will load current_page
Parameters:
|
DB_Connection |
$dbc: |
DB_Connection object |
|
integer |
$page: |
Page to be loaded. Default = NULL - will load current page |
API Tags:
Retrieves rows from DB
Parameters:
|
DB_Connection |
$dbc: |
|
|
integer |
$page: |
Rows for page $page will be retrieved |
API Tags:
void send_data_to_grid(
array
$rows, integer
$page, integer
$total_pages, integer
$total_rows
)
|
|
Sends retrieved rows and other data to the grid object
Parameters:
|
array |
$rows: |
|
|
integer |
$page: |
|
|
integer |
$total_pages: |
|
|
integer |
$total_rows: |
|
API Tags:
void set_additional_parameters(
array
$params
)
|
|
Sets additional_parameters at once
Parameters:
|
array |
$params: |
Simple array key => value pairs |
API Tags:
Information Tags:
void set_method(
integer
$method
)
|
|
Sets method for receiving command
Parameters:
API Tags:
| Internal: | |
| Access: | protected |
void set_page(
integer
$page
)
|
|
Sets current page
Parameters:
API Tags:
void set_system_name(
unknown_type
$system_name
)
|
|
Sets system name
Parameters:
|
unknown_type |
$system_name: |
|
API Tags:
| Internal: | |
| Access: | protected |
Information Tags:
void set_user_defined_post_processing_method(
string
$method_name
)
|
|
Sets user defined method that will be called for postprocessing of the rows
Two parameters will be passed to postprocessing method: $dbc and $rows where $dbc is DB_Connection instance and $rows contains all rows of the current page of the grid. Postprocessing method have to return an array containing new/modified data. Access to postprocessing method have to be "protected" in order grid_ctrl to be able to call it.
Example: $this->set_user_defined_post_processing_method('my_postprocessing');
protected function my_posprocessing(DB_Connection $dbc, $rows) { // ..some processing - for example loading additional data per row, doing some calculation with existing data and populating new row cell, etc. return $new_rows; }
Parameters:
|
string |
$method_name: |
This method have to be defined in descendant class otherwise exception will be thrown |
API Tags:
Information Tags:
Sets Vars_Manager object
Parameters:
API Tags:
Ensures that object returned by $this->create_grid(); will be instance of Grid
API Tags:
Information Tags:
void _create_paginate_db_data(
)
|
|
Ensures that object returned by $this->create_paginate_db_data(); will beinstance of Paginate_DB_Data
API Tags:
Information Tags: