# defender-security/3.1.0/src/model/email-track.php

Defender Security – Malware Scanner, Login Security &amp; Firewall, version 3.1.0. 46 lines.

- Page: https://pluginprobe.com/plugins/defender-security/3.1.0/code/src/model/email-track.php
- Raw: https://pluginprobe.com/plugins/defender-security/3.1.0/raw/src/model/email-track.php
- Modified: 2020-12-28T12:52:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/defender-security/3.1.0/code/src/model/email-track.php#L10-L20`.

```php
<?php

namespace WP_Defender\Model;

use WP_Defender\DB;

class Email_Track extends DB {
	protected $table = 'defender_email_log';

	/**
	 * @var int
	 * @defender_property
	 */
	public $id;
	/**
	 * @var int
	 * @defender_property
	 */
	public $timestamp;
	/**
	 * @var string
	 * @defender_property
	 */
	public $source;
	/**
	 * @var string
	 * @defender_property
	 */
	public $to;

	/**
	 * @param $source
	 * @param $email
	 * @param $date_from
	 * @param $date_to
	 *
	 * @return string|null
	 */
	public static function count( $source, $email, $date_from, $date_to ) {
		$orm = self::get_orm();

		return $orm->get_repository( self::class )->where( 'source', $source )
		           ->where( 'to', $email )->where( 'timestamp', '>=', $date_from )
		           ->where( 'timestamp', '<=', $date_to )->count();
	}
}
```
