<?php
/**
 * BookiFlex Core
 *
 * @package    BookiFlex
 * @subpackage Core
 * @author     BookiFlex
 * @copyright  Copyright (c) 2025 BookiFlex
 * @license    GPL-2.0-or-later
 *
 * @link       https://bookiflex.com
 */

declare(strict_types=1);

namespace BookiFlex\Core\ORM\Mapper;

use Cycle\ORM\Command\CommandInterface;
use Cycle\ORM\Heap\Node;
use Cycle\ORM\Heap\State;
use Cycle\ORM\Mapper\Mapper;
use RuntimeException;

defined( 'ABSPATH' ) || exit;

class ReadOnlyMapper extends Mapper
{
    public function queueCreate(object $entity, Node $node, State $state): CommandInterface
    {
        throw new RuntimeException('Entity is read-only');
    }

    public function queueUpdate(object $entity, Node $node, State $state): CommandInterface
    {
        throw new RuntimeException('Entity is read-only');
    }

    public function queueDelete(object $entity, Node $node, State $state): CommandInterface
    {
        throw new RuntimeException('Entity is read-only');
    }
}
