<?php

namespace SovereignStack\SecuritySafe;

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

require_once( SECSAFE_DIR_ADMIN_TABLES . '/Table.php' );

/**
 * Class Table404s
 *
 * @package SecuritySafe
 */
final class TableActivity extends Table {

	/**
	 * Get a list of columns. The format is:
	 * 'internal-name' => 'Title'
	 *
	 * @package WordPress
	 * @since   3.1.0
	 * @abstract
	 *
	 * @return array
	 */
	function get_columns() {

		return [
			'date' => __( 'Date', 'security-safe' ),
			'username' => __( 'Username', 'security-safe' ),
			'ip' => __( 'IP Address', 'security-safe' ),
			'user_agent' => __( 'User Agent', 'security-safe' ),
			'details' => __( 'Details', 'security-safe' ),
			'status' => __( 'Status', 'security-safe' ),
		];
	}

	/**
	 * Set the type of data to display
	 *
	 * @since  2.0.0
	 */
	protected function set_type() {

		$this->type = 'activity';
	}

	/**
	 * Get the array of searchable columns in the database
	 *
	 * @since  2.0.0
	 * @return  array An unassociated array.
	 */
	protected function get_searchable_columns() {

		return [
			'username',
			'ip',
			'details',
		];
	}
}
