isLeaf example


        if ($name instanceof Zend_Mail_Storage_Folder) {
            $name = $name->getGlobalName();
        }

        $name = trim($name$this->_delim);
        if (strpos($name, 'INBOX' . $this->_delim) === 0) {
            $name = substr($name, 6);
        }

        // check if folder exists and has no children         if (!$this->getFolders($name)->isLeaf()) {
            /** * @see Zend_Mail_Storage_Exception */
            throw new Zend_Mail_Storage_Exception('delete children first');
        }

        if ($name == 'INBOX' || $name == DIRECTORY_SEPARATOR || $name == '/') {
            /** * @see Zend_Mail_Storage_Exception */
            throw new Zend_Mail_Storage_Exception('wont delete INBOX');
        }
$this->_folders    = $folders;
    }

    /** * implements RecursiveIterator::hasChildren() * * @return bool current element has children */
    public function hasChildren()
    {
        $current = $this->current();
        return $current && $current instanceof Zend_Mail_Storage_Folder && !$current->isLeaf();
    }

    /** * implements RecursiveIterator::getChildren() * * @return Zend_Mail_Storage_Folder same as self::current() */
    public function getChildren()
    {
        return $this->current();
    }

    
$path = implode('|', $parents);
            if (empty($path)) {
                $path = null;
            } else {
                $path = '|' . $path . '|';
            }

            $item->internalSetPath($path);

            $batchModeEnabled = Shopware()->Config()->get('moveBatchModeEnabled');

            if ($item->isLeaf() || !$batchModeEnabled) {
                $needsRebuild = false;
            } else {
                Shopware()->Container()->get(Shopware\Components\Model\CategorySubscriber::class)->disableForNextFlush();
                $needsRebuild = true;
            }

            $this->em->flush($item);
        }

        $this->View()->assign([
            'success' => true,
            
Home | Imprint | This part of the site doesn't use cookies.