<?php

namespace apexl\Io\modules\payment\entities\operators;

use apexl\Io\operators\entityDatabaseOperator;

class paymentProviderRefOperator extends entityDatabaseOperator{

    public function __construct($table, $primaryKey = 'id')
    {
        parent::__construct($table, $primaryKey);
    }

    public function getUserRef($provider, $userId)
    {
        return $this->vault->select($this->dbTable)->fields()->where('user_id', $userId)->orderBy('id', 'DESC')->limit(1)->execute()->fetchAssoc();
    }
}