<?php

namespace App\Modules\PaxInformationRoomPassenger\Infrastructure;

use App\Modules\PaxInformationRoomPassenger\Domain\IdPaxInformationRoomPassenger;
use App\Modules\PaxInformationRoomPassenger\Domain\PaxInformationRoomPassenger;
use App\Modules\PaxInformationRoomPassenger\Domain\PaxInformationRoomPassengerRepository;
use App\Modules\Shared\Domain\Storage\Criteria\StorageCriteria;
use App\Modules\Shared\Infraestructure\DBRequester;

class MysqlPaxInformationRoomPassengerRepository implements PaxInformationRoomPassengerRepository
{
    public function find(StorageCriteria $criteria): PaxInformationRoomPassenger
    {
        return $criteria->run();
    }

    public function search(StorageCriteria $criteria): array
    {
        return $criteria->run();
    }

    public function insert(PaxInformationRoomPassenger $value): IdPaxInformationRoomPassenger
    {
        return new IdPaxInformationRoomPassenger(DBRequester::requestInsert($value));
    }

    public function update(PaxInformationRoomPassenger $value)
    {
        return DBRequester::requestUpdate($value);
    }
}
