<?php
namespace Claromentis\Infocapture\Repository;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"] ?: array()) + array();
use Claromentis\Core\DAL;
class IssueRepository
{
    protected DAL\Db $database;
    public function __construct(DAL\Db $_4504853ce5094b088c8bdc3d570a0a5d)
    {
        $this->database = $_4504853ce5094b088c8bdc3d570a0a5d;
    }
    
    
    
    
    
    
    
    public function findIssue($id) : ?\HDIssue
    {
        $issue = new \HDIssue($this->database);
        
        
        if (!$issue->Load($id)) {
            return null;
        }
        return $issue;
    }
    
    
    
    
    
    
    
    
    public function findProjectIssue(int $projectId, int $issueIid) : ?\HDIssue
    {
        $id = $this->getIssueId($projectId, $issueIid);
        return $this->findIssue($id);
    }
    
    
    
    
    
    
    
    
    
    
    public function getIssueId(int $projectId, int $issueIid) : int
    {
        return \HDIssue::GetIssueId($projectId, $issueIid);
    }
}