Owl\Services\ReminderService::create PHP Method

create() public method

public create ( $userId, $token )
    public function create($userId, $token)
    {
        $params = [];
        $params['user_id'] = $userId;
        $params['token'] = $token;
        $data = $this->getByUserId($userId);
        if (empty($data)) {
            $ret = $this->reminderTokenRepo->insert($params);
        } else {
            $wkey = ['id' => $data->id];
            $ret = $this->reminderTokenRepo->update($params, $wkey);
        }
        return $ret;
    }