<?php

namespace Vendtics\App\Repositories;

defined( 'ABSPATH' ) || exit;

use Vendtics\WpMVC\DTO\DTO;
use Vendtics\WpMVC\Database\Query\Builder;

/**
 * Abstract class Repository
 * Provides a base implementation for a repository pattern to interact with the database.
 */
abstract class Repository extends \Vendtics\WpMVC\Repositories\Repository {
    protected function update_column( int $id, string $column, $value ) {
        return $this->get_query_builder()->where( 'id', $id )->update(
            [
                $column => $value
            ]
        );
    }

    public function bulk_delete( array $ids ) {
        return $this->get_query_builder()->where_in( 'id', $ids )->delete();
    }
}