views_handler_field_last_comment_timestamp.inc

Same filename in other branches
  1. 6.x-3.x modules/comment/views_handler_field_last_comment_timestamp.inc

Definition of views_handler_field_last_comment_timestamp.

File

modules/comment/views_handler_field_last_comment_timestamp.inc

View source
<?php


/**
 * @file
 * Definition of views_handler_field_last_comment_timestamp.
 */

/**
 * Field handler to display the timestamp of a comment with the comments count.
 *
 * @ingroup views_field_handlers
 */
class views_handler_field_last_comment_timestamp extends views_handler_field_date {
    
    /**
     * {@inheritdoc}
     */
    public function construct() {
        parent::construct();
        $this->additional_fields['comment_count'] = 'comment_count';
    }
    
    /**
     * {@inheritdoc}
     */
    public function render($values) {
        $comment_count = $this->get_value($values, 'comment_count');
        if (empty($this->options['empty_zero']) || $comment_count) {
            return parent::render($values);
        }
        else {
            return NULL;
        }
    }

}

Classes

Title Deprecated Summary
views_handler_field_last_comment_timestamp Field handler to display the timestamp of a comment with the comments count.