<?php
namespace Claromentis\Documents;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"] = (@$GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"] ?: array()) + array("_ad91c758fdbad4d3337db09" . "e238b256f" => base64_decode("aXNfc2N" . "hbGFy"));
use ERMSBrowser;
use ERMSFolder;





















class FolderIterator extends FolderIdsIterator
{
    protected $objects_cache;
    
    
    
    
    
    
    
    public function __construct($_a4b4fe29a876bd36f8024f56a625bf4c, $_9217945053dcf5f2b8e7f005e1025e64 = false, $_601a171d59986f7c15972b586685671b = self::LEAVES_FIRST, $_25467b9c95c4c672788507e4e0284f32 = false)
    {
        $folder_id = $GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_ad91c758fdbad4d3337db09e238b256" . "f"]($_a4b4fe29a876bd36f8024f56a625bf4c) ? $_a4b4fe29a876bd36f8024f56a625bf4c : $_a4b4fe29a876bd36f8024f56a625bf4c->GetId();
        parent::__construct($folder_id, $_9217945053dcf5f2b8e7f005e1025e64, $_601a171d59986f7c15972b586685671b, $_25467b9c95c4c672788507e4e0284f32);
    }
    public function current()
    {
        if (isset($this->objects_cache[$this->pos])) {
            return $this->objects_cache[$this->pos];
        }
        $_6aead4bff5639b251aebcf8a630e43a7 = parent::current();
        $_68ffaaa31e3ba49ed9d6159fbee9f043 = ERMSBrowser::I()->GetERMSObject($_6aead4bff5639b251aebcf8a630e43a7[1], $_6aead4bff5639b251aebcf8a630e43a7[0], $_6aead4bff5639b251aebcf8a630e43a7[2], $this->include_deleted);
        if (!$_68ffaaa31e3ba49ed9d6159fbee9f043) {
            throw new \Exception(ERMSBrowser::I()->GetErrMsg());
        }
        if ($this->cache_all) {
            $this->objects_cache[$this->pos] = $_68ffaaa31e3ba49ed9d6159fbee9f043;
        } else {
            $this->objects_cache = array($this->pos => $_68ffaaa31e3ba49ed9d6159fbee9f043);
        }
        return $this->objects_cache[$this->pos];
    }
    
    
    
    
    
    
    public function hasChildren()
    {
        if (!parent::hasChildren()) {
            return false;
        }
        
        
        $_a4b4fe29a876bd36f8024f56a625bf4c = $this->current();
        return !$_a4b4fe29a876bd36f8024f56a625bf4c->IsEmpty($this->include_deleted);
    }
}