Old_Comment_Model Class Reference
Handle comments for hosts and services.
More...
Public Member Functions |
| search ($value=false, $limit=false) |
| Search through several fields for a specific value.
|
| get_where ($field=false, $value=false, $limit=false) |
| Fetch comment info filtered on specific field and value.
|
Static Public Member Functions |
static | fetch_comments_by_object ($host=false, $service=false, $num_per_page=false, $offset=false, $count=false) |
| Fetch saved comments for host or service.
|
static | fetch_comments_by_user ($for_services=false, $num_per_page=false, $offset=false, $count=false) |
| Fetch all host or all service comments the current user may see.
|
static | fetch_all_comment_types ($entry_type, $host_name, $service_description) |
| Fetch all comments of a specified type for a specified host or service.
|
static | count_comments_by_object ($host=false, $service=false) |
| Wrapper method to fetch nr of comments for host or service.
|
static | count_comments_by_user ($host=false, $service=false) |
| Wrapper method to fetch a count of all service- or host comments.
|
static | count_all_comments_by_object ($service=false) |
| Fetch comment counts for all objects that has comments Returned array will contain object name as key and count as value for all objects with comments.
|
Data Fields |
const | HOST_COMMENT = 1 |
| Comment applies to host.
|
const | SERVICE_COMMENT = 2 |
| Comment applies to service.
|
const | USER_COMMENT = 1 |
| Comment is entered by user.
|
const | DOWNTIME_COMMENT = 2 |
| Comment is generated by a downtime.
|
const | FLAPPING_COMMENT = 3 |
| Comment is generated because object is flapping.
|
const | ACKNOWLEDGEMENT_COMMENT = 4 |
| Comment is generated from an acknowledgement.
|
const | TABLE_NAME = 'comments' |
| The name of the comment livestatus table.
|
Detailed Description
Handle comments for hosts and services.
Member Function Documentation
static Old_Comment_Model::fetch_all_comment_types |
( |
$ |
entry_type, |
|
|
$ |
host_name, |
|
|
$ |
service_description | |
|
) |
| | [static] |
Fetch all comments of a specified type for a specified host or service.
- Parameters:
-
| $entry_type | The comment type as an integer |
| $host_name | Host name |
| $service_description | Service description, or empty to fetch for host |
- Returns:
- DB result, or false on error or empty
static Old_Comment_Model::fetch_comments_by_object |
( |
$ |
host = false , |
|
|
$ |
service = false , |
|
|
$ |
num_per_page = false , |
|
|
$ |
offset = false , |
|
|
$ |
count = false | |
|
) |
| | [static] |
Fetch saved comments for host or service.
- Parameters:
-
| $host | string Host name - must be set |
| $service | string Service description, or false to get comments for a host |
| $num_per_page | int Number of rows to retrieve |
| $offset | int Number of rows to skip before retrieving first row |
| $count | bool Completely ignore the two previous options - return the total number of comments instead of the comments themselves |
- Returns:
- If $count is true, then the number of rows as an int, otherwise the database result of comments
static Old_Comment_Model::fetch_comments_by_user |
( |
$ |
for_services = false , |
|
|
$ |
num_per_page = false , |
|
|
$ |
offset = false , |
|
|
$ |
count = false | |
|
) |
| | [static] |
Fetch all host or all service comments the current user may see.
- Parameters:
-
| $for_services | bool If true, fetch service comments, else fetch host comments |
| $num_per_page | int Number of rows to retrieve |
| $offset | int Number of rows to skip before retrieving first row |
| $count | bool Completely ignore the two previous options - return the total number of comments instead of the comments themselves |
- Returns:
- If $count is true, then the number of rows as an int, otherwise the database result of comments
The documentation for this class was generated from the following file: