* @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2 * @author Icinga Development Team */ // {{{ICINGA_LICENSE_HEADER}}} namespace Icinga\Module\Monitoring\DataView; /** * View representation for comments */ class Comment extends DataView { /** * Retrieve columns provided by this view * * @return array */ public function getColumns() { return array( 'comment_objecttype_id', 'comment_id', 'comment_data', 'comment_author', 'comment_timestamp', 'comment_type', 'comment_is_persistent', 'comment_expiration_timestamp', 'host_name', 'service_name', 'host', 'service' ); } /** * Retrieve default sorting rules for particular columns. These involve sort order and potential additional to sort * * @return array */ public function getSortRules() { return array( 'comment_timestamp' => array( 'order' => self::SORT_DESC ), 'host_service' => array( 'columns' => array( 'host_name', 'service_name' ), 'order' => self::SORT_ASC ), 'comment_id' => array( 'order' => self::SORT_ASC ), 'comment_expires' => array( 'order' => self::SORT_DESC ) ); } }