Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/old/vendor/extmag/shiplab/Helper/Config/Structure/Element/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/extmag/shiplab/Helper/Config/Structure/Element/AbstractComposite.php
<?php
/**
 * Copyright © Extmag. All rights reserved.
 */

namespace Extmag\Shiplab\Helper\Config\Structure\Element;

use Extmag\Shiplab\Helper\Config\Structure\AbstractElement;
use Magento\Config\Model\Config\Structure\ElementVisibilityComposite;
use Magento\Framework\Module\Manager;
use Magento\Store\Model\StoreManagerInterface;

abstract class AbstractComposite extends AbstractElement
{
    /**
     * Child elements iterator
     *
     * @var Iterator
     */
    protected $_childrenIterator;

    /**
     * @param StoreManagerInterface $storeManager
     * @param Manager $moduleManager
     * @param Iterator $childrenIterator
     * @param ElementVisibilityComposite $elementVisibility
     */
    public function __construct(
        StoreManagerInterface $storeManager,
        Manager $moduleManager,
        Iterator $childrenIterator,
        ElementVisibilityComposite $elementVisibility
    ) {
        parent::__construct($storeManager, $moduleManager, $elementVisibility);
        $this->_childrenIterator = $childrenIterator;
    }

    /**
     * Set flyweight data
     *
     * @param array $data
     * @param string $scope
     * @return void
     */
    public function setData(array $data, $scope)
    {
        parent::setData($data, $scope);
        $children = isset(
            $this->_data['children']
        ) && is_array(
            $this->_data['children']
        ) ? $this->_data['children'] : [];
        $this->_childrenIterator->setElements($children, $scope);
    }

    /**
     * Check whether element is visible
     *
     * @return bool
     */
    public function isVisible()
    {
        if (parent::isVisible()) {
            return $this->hasChildren() || $this->getFrontendModel();
        }
        return false;
    }

    /**
     * Check whether element has visible child elements
     *
     * @return bool
     */
    public function hasChildren()
    {
        foreach ($this->getChildren() as $child) {
            return (bool)$child;
        }
        return false;
    }

    /**
     * Retrieve children iterator
     *
     * @return Iterator
     */
    public function getChildren()
    {
        return $this->_childrenIterator;
    }
}

Spamworldpro Mini