<?php

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

use apexl\Io\operators\entityDatabaseOperator;

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

    public function loadByToken($token)
    {
        $entity = $this->vault->select($this->dbTable)->fields()->where('token', $token)->execute()->fetchAssoc();
        return ['updateEntityData' => true, 'data' => $entity];
    }
}
