Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace Drupal\comment\Plugin\views\field; use Drupal\views\Plugin\views\field\D..

Decoded Output download

<?php

namespace Drupal\comment\Pluginiewsield;

use Drupaliews\Pluginiewsield\Date;
use Drupaliews\Pluginiews\display\DisplayPluginBase;
use Drupaliews\ResultRow;
use Drupaliews\ViewExecutable;

/**
 * Field handler to display the timestamp of a comment with the count of comments.
 *
 * @ingroup views_field_handlers
 *
 * @ViewsField("comment_last_timestamp")
 */
class LastTimestamp extends Date {

  /**
   * {@inheritdoc}
   */
  public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
    parent::init($view, $display, $options);

    $this->additional_fields['comment_count'] = 'comment_count';
  }

  /**
   * {@inheritdoc}
   */
  public function render(ResultRow $values) {
    $comment_count = $this->getValue($values, 'comment_count');
    if (empty($this->options['empty_zero']) || $comment_count) {
      return parent::render($values);
    }
    else {
      return NULL;
    }
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace Drupal\comment\Plugin\views\field;

use Drupal\views\Plugin\views\field\Date;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\ResultRow;
use Drupal\views\ViewExecutable;

/**
 * Field handler to display the timestamp of a comment with the count of comments.
 *
 * @ingroup views_field_handlers
 *
 * @ViewsField("comment_last_timestamp")
 */
class LastTimestamp extends Date {

  /**
   * {@inheritdoc}
   */
  public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
    parent::init($view, $display, $options);

    $this->additional_fields['comment_count'] = 'comment_count';
  }

  /**
   * {@inheritdoc}
   */
  public function render(ResultRow $values) {
    $comment_count = $this->getValue($values, 'comment_count');
    if (empty($this->options['empty_zero']) || $comment_count) {
      return parent::render($values);
    }
    else {
      return NULL;
    }
  }

}

Function Calls

None

Variables

None

Stats

MD5 d9e8e28f6d9c6924076c26691b3baafa
Eval Count 0
Decode Time 94 ms