<?php

namespace Dolphy\Plugin\Security;

use Dolphy\Plugin\Core\BaseTable;
use Dolphy\Plugin\Exceptions\Exception;
use Dolphy\Plugin\Helpers\DB;
use WP_User;

final class DPLCVerified extends BaseTable {

  const TABLE = 'dplc_verified';

  public static function add($action, $code) {
    return self::insert(array(
      'action' => $action,
      'code' => $code
    ));
  }

  public static function check($action, $code) {
    $data = self::findWhere(array(
      'action' => $action,
      'code' => $code
    ));

    return !!$data;
  }

  public static function remove($action, $code) {
    self::delete(array(
      'action' => $action,
      'code' => $code
    ));
  }

}
