<?php
namespace Claromentis\Holidays\UseCase;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"] = (@$GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"] ?: array()) + array();
use Claromentis\Holidays\Facade\HolidaysAllowance;
use Claromentis\Holidays\Repository\RequestRepository;
use HpProcessActions;




class CountUserRequests
{
    protected $requests_repository;
    protected $holidays_allowance;
    public function __construct(RequestRepository $_42f41ba09524804c59832f9423e4a00b, HolidaysAllowance $_3f0dc084b600e272c7d27dcc2ccc8ebf)
    {
        $this->requests_repository = $_42f41ba09524804c59832f9423e4a00b;
        $this->holidays_allowance = $_3f0dc084b600e272c7d27dcc2ccc8ebf;
    }
    
    
    
    
    
    
    
    public function GetPendingCount($user_id, $_3e373b62dabc05e536ff20103c34887e)
    {
        list($_bd99930a41d8c472a038ab03806034ff, $_14eb50921c0847b6f7559154b4317a18) = $this->holidays_allowance->GetYearDates($user_id, $_3e373b62dabc05e536ff20103c34887e);
        $_0a5f94b5ef9f9d3b470a55833658fecf = $this->requests_repository->GetByUserAndDate($user_id, $_bd99930a41d8c472a038ab03806034ff, $_14eb50921c0847b6f7559154b4317a18);
        $_5b35043dd33b6fd8bd03e5a12d19fd87 = 0;
        $_4c183dbf3ba3f28bdb680cbac9689447 = 0;
        $_14bd517e834e8eadf0da3a3232fb60eb = new HpProcessActions($user_id);
        foreach ($_0a5f94b5ef9f9d3b470a55833658fecf as $request) {
            if ($request->GetStatus() == HP_STATUS_REQUESTED) {
                $_5b35043dd33b6fd8bd03e5a12d19fd87 += $request->GetDays();
                $_4c183dbf3ba3f28bdb680cbac9689447 += $_14bd517e834e8eadf0da3a3232fb60eb->CountAffectedDays($request);
            }
        }
        return array($_4c183dbf3ba3f28bdb680cbac9689447, $_5b35043dd33b6fd8bd03e5a12d19fd87);
    }
}