Room Helper Functions
The helper you can use to create, delete, get and update Room details in the company.
function add_room($room) {.....}
Supported hooks
Filter name: before_add_room Description: This filter would be executed before add room into the database in add_room helper. Usage:
// The filter callback function is based on the filter.
add_filter( ‘before_add_room’, ‘before_room_tax_callback_fun’, 10, 1 );
function before_add_room_callback_fun($room) {
// code
}Filter name: should_add_room Description: This filter would be executed before add room into database in add_room helper. Usage:
// The filter callback function is based on the filter.
add_filter( ‘should_add_room’, ‘should_add_room_callback_fun’, 10, 1 );
function should_add_room_callback_fun($room) {
// code
}hook name: pre.add.room Description: This hook would be executed before add room into the database in add_room helper. Usage:
hook name: post.add.room Description: This hook would be executed after add room into the database in add_room helper. Usage:
Usage
Request Parameters
Parameters in array format includes following attributes:
room_name
Character
Yes
Null
The room_name of a specific room.
room_type_id
Integer
Yes
0
The room_type_id for a specific room.
sort_order
Integer
Yes
0
The sort_order for a specific room.
status
Character
Yes
Clean
The room status for a specific room.
group_id
Integer
0
The group_id for a specific room.
floor_id
Integer
0
The floor_id for a specific room.
location_id
Integer
0
The location_id for a specific room.
score
Integer
0
The score for a specific room.
instructions
Text
Null
The instructions for a specific room.
can_be_sold_online
Integer
1
The can_be_sold_online for a specific room.
notes
Text
Null
The notes for a specific room.
company_id
Integer
Yes
Null
The company_id for specific room.
Response
function get_room($room_id) {....}
Supported hooks
Filter name: before_get_room Description: This filter would be executed before retrieving room details from database in get_room helper. Usage:
Filter name: should_get_room Description: This filter would be executed before retrieving room details from database in get_room helper. Usage:
hook name: pre.get.room Description: This hook would be executed before retrieving room details from database in get_room helper. Usage:
hook name: post.get.room Description: This hook would be executed after retrieving room details from database in get_room helper. Usage:
Usage
Request Parameters
$room_id
Integer
Yes
Null
The primary id of the room corresponds to the room table
Response
function get_rooms($filter) {.....}
Supported hooks
Filter name: before_get_rooms Description: This filter would be executed before retrieving room details from database in get_rooms helper. Usage:
Filter name: should_get_rooms Description: This filter would be executed before retrieving room details from database in get_rooms helper. Usage:
hook name: pre.get.rooms Description: This hook would be executed before retrieving room details from database in get_rooms helper. Usage:
hook name: post.get.rooms Description: This hook would be executed after retrieving room details from database in get_rooms helper. Usage:
Usage
Request Parameters
parameter array filter required for room details.
room_name
Character
Yes
Null
The room_name for a specific room.
company_id
Integer
Yes
Null
The company_id for specific room.
room_type_id
Integer
yes
Null
The room_type_id for specific room.
Response
function update_room($room, $room_id) {....}
Usage
Supported hooks
Filter name: before_update_room Description: This filter would be executed before update room into the database in update_room helper. Usage:
Filter name: should_update_room Description: This filter would be executed before update room into database in update_room helper. Usage:
hook name: pre.update.room Description: This hook would be executed before update room into the database in update_room helper. Usage:
hook name: post.update.room Description: This hook would be executed after update room into the database in update_room helper. Usage:
Request Parameters
Request required room_id and array format data includes following attributes:
room_id
Integer
Yes
Null
The room_id primary key of a specific room.
room_name
Character
Yes
Null
The room_name of a specific room.
room_type_id
Integer
Yes
0
The room_type_id for a specific room.
sort_order
Integer
Yes
0
The sort_order for a specific room.
status
Character
Yes
Clean
The room status for a specific room.
group_id
Integer
0
The group_id for a specific room.
floor_id
Integer
0
The floor_id for a specific room.
location_id
Integer
0
The location_id for a specific room.
score
Integer
0
The score for a specific room.
instructions
Text
Null
The instructions for a specific room.
can_be_sold_online
Integer
1
The can_be_sold_online for a specific room.
notes
Text
Null
The notes for a specific room.
company_id
Integer
Yes
Null
The company_id for specific room.
Response
function delete_room($room_id) {.....}
Usage
Request Parameters
$room_id
integer
yes
null
The id of the room corresponds to the room table
Response
Last updated