The helper you can use to create, delete, get and update Statement details.
function add_statement($statement) {.....}
Supported hooks
Filter name: before_add_statementDescription: This filter would be executed before add statement into the database in add_statement helper.
Usage:
// The filter callback function is based on the filter.add_filter( ‘before_add_statement’, ‘before_add_statement_callback_fun’,10,1);functionbefore_add_statement_callback_fun($statement) {// code}
Filter name: should_add_statementDescription: This filter would be executed before add statement into database in add_statement helper.
Usage:
// The filter callback function is based on the filter.add_filter( ‘should_add_statement’, ‘should_add_statement_callback_fun’,10,1);functionshould_add_statement_callback_fun($statement) {// code}
hook name: pre.add.statement
Description: This hook would be executed before add statement into the database in add_statement helper.
Usage:
hook name: post.add.statement
Description: This hook would be executed after add statement into the database in add_statement helper.
Usage:
Usage
Request Parameters
Parameters in array format includes following attributes:
Param
Type
Required
Default
Description
statement_number
Integer
Yes
Null
The statement_number of a specific statement.
creation_date
Date_time
Null
the creation_date for specific statement ( must provide date in gmdate() format)
statement_name
Character
Yes
Null
The statement_name for specific statement.
booking_id
Integer
Yes
Null
The booking_id create for a specific booking statement.
Response
function get_statement($statement_id) {....}
Supported hooks
Filter name: before_get_statementDescription: This filter would be executed before retrieving statement details from database in get_statement helper.
Usage:
Filter name: should_get_statementDescription: This filter would be executed before retrieving statement details from database in get_statement helper.
Usage:
hook name: pre.get.statement
Description: This hook would be executed before retrieving statement details from database in get_statement helper.
Usage:
hook name: post.get.statement
Description: This hook would be executed after retrieving statement details from database in get_statement helper.
Usage:
Usage
Request Parameters
Param
Type
Required
Default
Description
$statement_id
Integer
Yes
Null
The id of the statement corresponds to the statement table
Response
function get_statements($filter) {.....}
Supported hooks
Filter name: before_get_statementsDescription: This filter would be executed before retrieving statement details from database in get_statements helper.
Usage:
Filter name: should_get_statementsDescription: This filter would be executed before retrieving statement details from database in get_statements helper.
Usage:
hook name: pre.get.statements
Description: This hook would be executed before retrieving statement details from database in get_statements helper.
Usage:
hook name: post.get.statements
Description: This hook would be executed after retrieving statement details from database in get_statements helper.
Usage:
Usage
Request Parameters
parameter array filter required for statement details.
Param
Type
Required
Default
Description
statement_name
Character
Yes
Null
The statement_name for a specific statement.
booking_id
Integer
Yes
Null
The booking_id for specific statement.
Response
function update_statement($statement, $statement_id) {....}
Usage
Supported hooks
Filter name: before_update_statementDescription: This filter would be executed before updatestatement into the database in update_statement helper.
Usage:
Filter name: should_update_statementDescription: This filter would be executed before update tax into database in update_statement helper.
Usage:
hook name: pre.update.statement
Description: This hook would be executed before update statement into the database in update_statement helper.
Usage:
hook name: post.update.statement
Description: This hook would be executed after update statement into the database in update_statement helper.
Usage:
Request Parameters
Request required statement_id and array format data includes following attributes:
Param
Type
Required
Default
Description
statement_number
Integer
Yes
Null
The statement_number of a specific statement.
creation_date
Date_time
Null
the creation_date for specific statement ( must provide date in gmdate() format)
statement_name
Character
Yes
Null
The statement_name for specific statement.
booking_id
Integer
Yes
Null
The booking_id create for a specific booking statement.
Response
function delete_statement ($statement_id) {.....}
Usage
Request Parameters
Param
Type
Required
Default
Description
$statement _id
integer
yes
null
The id of the statement corresponds to the statement table
// The filter callback function is based on the filter.
add_action('pre.add.statement', 'pre_add_statement_callback_fun', 10, 1);
function pre_add_statement_callback_fun($statement) {
// code
}
// The filter callback function is based on the filter.
add_action('post.add.statement', 'post_add_statement_callback_fun', 10, 1);
function post_add_statement_callback_fun($statement) {
// code
}
// for use statement helper you need to add this helper on controller or
// you can autoload this helper.
$this->load->helper('includes/statement');
// add a new statement in statement table.
$statement_id = add_statement($statement);
Response includes the following attributes:
if data have been added successfully it would return the key of specific statement id.
return $statement_id;
if data does not add it will return null.
// The filter callback function is based on the filter.
add_filter( ‘before_get_statement’, ‘before_get_statement_callback_fun’, 10, 1 );
function before_get_statement_callback_fun($statement_id) {
// code
}
// The filter callback function is based on the filter.
add_filter( ‘should_get_statement’, ‘should_get_statement_callback_fun’, 10, 1 );
function should_get_statement_callback_fun($statement_id) {
// code
}
// The filter callback function is based on the filter.
add_action('pre.get.statement', 'pre_get_statement_callback_fun', 10, 1);
function pre_get_statement_callback_fun($statement_id) {
// code
}
// The filter callback function is based on the filter.
add_action('post.get.statement', 'post_get_statement_callback_fun', 10, 1);
function post_get_statement_callback_fun($statement_id) {
// code
}
// Retrieves statementdata based on a statement_id.
$statement_data = get_statement($statement_id);
// $response array includes following attributes:
// $response['statement_number'] : the statement_number of specific statement.
// $response['creation_date'] : the creation_date for specific statement .
// $response['statement_name'] : the statement_name for specific statement.
// $response['booking_id'] : the booking_id for specific statement.
// and many more attributes for table statement and join with booking_x_statement table.
// Successfully response giving you array of statement data.
Array
(
[0] => Array
(
[statement_id] => 1
[statement_number] => 0
[is_deleted] => 0
[creation_date] => 2022-01-24 05:58:43
[statement_name] => booking create
[booking_id] => 1
)
)
// If there is no statement data for any statement id provided in input or any error will return null.
// The filter callback function is based on the filter.
add_filter( ‘before_get_statements’, ‘before_get_statements_callback_fun’, 10, 1 );
function before_get_statements_callback_fun($filter) {
// code
}
// The filter callback function is based on the filter.
add_filter( ‘should_get_statements’, ‘should_get_statements_callback_fun’, 10, 1 );
function should_get_statements_callback_fun($filter) {
// code
}
// The filter callback function is based on the filter.
add_action('pre.get.statements', 'pre_get_statements_callback_fun', 10, 1);
function pre_get_statements_callback_fun($filter) {
// code
}
// The filter callback function is based on the filter.
add_action('post.get.statements', 'post_get_statements_callback_fun', 10, 1);
function post_get_statements_callback_fun($filter) {
// code
}
// Retrieves statement data based on a filter array.
$statement_data = get_statements($filter);
// $response array includes following attributes:
// $response['statement_number'] : the statement_number of specific statement.
// $response['creation_date'] : the creation_date for specific statement .
// $response['statement_name'] : the statement_name for specific statement.
// $response['booking_id'] : the booking_id for specific statement.
// and many more attributes for table statement and join with booking_x_statement table.
// Successfully response giving you array of statement data.
Array
(
[0] => Array
(
[statement_id] => 1
[statement_number] => 0
[is_deleted] => 0
[creation_date] => 2022-01-24 05:58:43
[statement_name] => booking create must need
[booking_id] => 1
)
)
// If there is no statement data for filter provided in input or any error will return null.
// update statement data based on a statement array data and statement_id.
update_statement($statement, $statement_id);
// The filter callback function is based on the filter.
add_filter( ‘before_update_statement’, ‘before_update_statement_callback_fun’, 10, 1 );
function before_update_statement_callback_fun($statement, $statement_id) {
// code
}
// The filter callback function is based on the filter.
add_filter( ‘should_update_statement’, ‘should_update_statement_callback_fun’, 10, 1 );
function should_update_statement_callback_fun($statement, $statement_id) {
// code
}
// The filter callback function is based on the filter.
add_action('pre.update.statement', 'pre_update_statement_callback_fun', 10, 1);
function pre_update_statement_callback_fun($statement, $statement_id) {
// code
}
// The filter callback function is based on the filter.
add_action('post.update.statement', 'post_update_statement_callback_fun', 10, 1);
function post_update_statement_callback_fun($statement, $statement_id) {
// code
}
Response return mixed Either true or null if statement data is updated then true else null.
// delete a statement data from the statement table. it's a soft delete process only status will change data still existing in the backend database.
delete_statement($statement_id);
Response return mixed Either true or null if statement data is deleted then true
else null.