<?php
namespace Claromentis\Pages\UseCase;

$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"] ?: array()) + array();
use Claromentis\Core\Component\Exception\MissingComponentException;
use Claromentis\Core\Security\SecurityContext;
use Claromentis\Pages\Component\PagesComponentList;
use Claromentis\Pages\Exception\AccessDeniedException;
use Claromentis\Pages\PagesAcl;




class GetComponentsList
{
    protected $pages_component_list;
    protected $acl;
    public function __construct(PagesComponentList $_7c5bdf613a4e4eeb538af291250fb41e, PagesAcl $acl)
    {
        $this->pages_component_list = $_7c5bdf613a4e4eeb538af291250fb41e;
        $this->acl = $acl;
    }
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    public function GetList(SecurityContext $context, $_c98a1df9521989cf9dc30b102286e173)
    {
        if (!$this->acl->CanListComponents($context)) {
            throw new AccessDeniedException();
        }
        $_9a9a71c432a50f9d93fb5e0d212082bf = $this->pages_component_list->GetComponentsKeys();
        $_09338c0a9af035a8d95260f96b7e1191 = [];
        foreach ($_9a9a71c432a50f9d93fb5e0d212082bf as $_cbc91abf342819eec93ad5eca696836a) {
            try {
                $_09338c0a9af035a8d95260f96b7e1191[$_cbc91abf342819eec93ad5eca696836a] = $this->pages_component_list->GetProperties($_cbc91abf342819eec93ad5eca696836a, $_c98a1df9521989cf9dc30b102286e173);
            } catch (MissingComponentException $_fe441aa3ef350bfb1a1a1ad8520dd530) {
                
                
            }
        }
        return $_09338c0a9af035a8d95260f96b7e1191;
    }
    
    
    
    
    
    
    
    
    
    
    
    
    public function GetOne(SecurityContext $context, $_cbc91abf342819eec93ad5eca696836a, $_809a58dc73011173c031a53c0b40ef0e)
    {
        if (!$this->acl->CanListComponents($context)) {
            throw new AccessDeniedException();
        }
        return $this->pages_component_list->GetProperties($_cbc91abf342819eec93ad5eca696836a, $_809a58dc73011173c031a53c0b40ef0e);
    }
}