Used when creating the navigation.
Hides folders without showable content

@return bool
174170
public function hasContent()
    {
        foreach ($this->getEntries() as $node) {
            if ($node instanceof Content) {
                return true;
            } elseif ($node instanceof self) {
                if ($node->hasContent()) {
                    return true;
                }
            }
        }

        return false;
    }
1190933
public function remove() : bool
    {
        $private = self::PRIVATE_ABSOLUTE_PATH . $this->destination . $this->privateFileName;
        $public = self::PUBLIC_ABSOLUTE_PATH . $this->destination;

        if (file_exists($private) || file_exists($public))
        {
            FileSystem::delete($private);
            FileSystem::delete($public);

            return TRUE;
        }

        return FALSE;
    }
584326
public function actionFilemanagerRemoveFiles()
    {
        $this->checkRouteAccess(self::PERMISSION_ROUTE);
        $pageId = Yii::$app->request->post('pageId', 0);
        $folderId = Yii::$app->request->post('folderId', 0);
        foreach (Yii::$app->request->post('ids', []) as $id) {
            if (!Storage::removeFile($id)) {
                return false;
            }
        }
        $this->flushApiCache($folderId, $pageId);
        return true;
    }
146424
public function showHelpOverlay()
    {
        $result = false;
        if (Config::get('concrete.misc.help_overlay')) {
            $u = new ConcreteUser();
            $timestamp = $u->config('MAIN_HELP_LAST_VIEWED');
            if (!$timestamp) {
                $result = true;
            }
        }

        return $result;
    }
741115
public function delete() {
        if (!$this->is_writable()) {
            return false;
        }

        if ($this->is_directory()) {
            $filepath = $this->lf->get_filepath();
            $fs = get_file_storage();
            $storedfiles = $fs->get_area_files($this->context->id, $this->get_component(), $this->lf->get_filearea(), $this->lf->get_itemid());
            foreach ($storedfiles as $file) {
                if (strpos($file->get_filepath(), $filepath) === 0) {
                    $file->delete();
                }
            }
        }

        return $this->lf->delete();
    }
999047
public function clear()
    {
        $result = true;
        $dir = new \DirectoryIterator($this->path);
        foreach ($dir as $file) {
            $extension = pathinfo($file->getFilename(), PATHINFO_EXTENSION);
            if (!$file->isDot() && $extension === 'ser') {
                if (!@unlink($this->path.'/'.$file->getFilename())) {
                    $result = false;
                }
            }
        }

        return $result;
    }
283843
public function hasSecondaryMenu()
    {
        $ident    = $this->ident();
        $metadata = $this->adminSecondaryMenu();

        if (isset($metadata[$ident])) {
            return $this->hasLinks() ||
                   $this->hasGroups() ||
                   $this->hasActions() ||
                   $this->showTitle() ||
                   $this->showDescription();
        }

        return false;
    }
739007
public function isDir(): bool
    {
        if ($this->caching == false) {
            return is_dir($this->getAbsoluteFilePath());
        }

        if ($this->isDir == null) {
            $this->isDir = is_dir($this->getAbsoluteFilePath());
        }

        return $this->isDir;
    }
1038246
public function clear() {
		if ( ! $this->enabled ) {
			return false;
		}

		$finder = $this->get_finder();

		foreach ( $finder as $file ) {
			unlink( $file->getRealPath() );
		}

		return true;
	}
647588
public function actionFolderCreate()
    {
        $this->checkRouteAccess(self::PERMISSION_ROUTE);
        
        $folderName = Yii::$app->request->post('folderName', null);
        $parentFolderId = Yii::$app->request->post('parentFolderId', 0);
        $response = Yii::$app->storage->addFolder($folderName, $parentFolderId);
        $this->flushApiCache();
        
        return $response;
    }
1282674
public function isVisible()
    {
        $oActivUser = \OxidEsales\Eshop\Core\Registry::getConfig()->getUser();
        $sActivUserId = null;
        if ($oActivUser) {
            $sActivUserId = $oActivUser->getId();
        }

        $blIsVisible = (bool) ($this->oxuserbaskets__oxpublic->value) ||
                       ($sActivUserId && ($this->oxuserbaskets__oxuserid->value == $sActivUserId));

        return $blIsVisible;
    }
540979
public function isShownInMenu()
    {
        if (!$this->isPage) return false;
        if ($this->generator instanceof Kwc_Root_Category_Generator) {
            //it's not worth for this single special case to add a generator method, but should be done if other special cases are needed
            return !$this->row->hide;
        } else {
            if (!$this->generator->hasSetting('showInMenu')) return false;
            return (bool)$this->generator->getSetting('showInMenu');
        }
    }
572091
protected function setSelectedNavigation()
    {
        $url = $this->getCurrentUrl();
        $sections = $this->getCurrentUrlSections();

        // laravel removes last /
        if ($url === false) {
            // dahboard (substring from the /, laravel removes last /)
            $nav = NavigationAdmin::whereSlug('/')->get()->last();
        }
        else {
            // find nav with url - get last (parent can have same url)
            $nav = NavigationAdmin::where('url', '=', $url)
                ->orderBy('is_hidden', 'DESC')//->orderBy('url_parent_id')
                ->orderBy('list_order')
                ->get()
                ->last();
        }

        // we assume some params / reserved word is at the end
        if (!$nav && strlen($url) > 2) {
            // keep cutting off from url until we find him in the db
            foreach ($sections as $key => $slug) {
                $url = substr($url, 0, strripos($url, '/'));

                // find nav with url - get last (parent can have same url)
                $nav = NavigationAdmin::whereUrl($url)->get()->last();
                if ($nav) {
                    break;
                }
            }
        }

        // development testing
        if (config('app.env') == 'local' && !$nav) {
            //$nav = NavigationAdmin::find(1);
            dump($url);
            dd('Whoops. Navigation not found - please see if url is in database (navigation_admin)');
            //return false;
        }

        $this->selectedNavigation = $nav;

        // get all navigations -> ON parent_id
        $this->parentNavs = $nav->getParentsAndYou();

        // get all navigations -> ON url_parent_id
        $this->urlParentNavs = $nav->getUrlParentsAndYou();

        // name of resource - used on page to, eg, Add new 'resource', enter title of 'resource'
        $this->resource = str_singular($nav->title); // TODO: - maybe add a 'resource' field on the table

        $mode = $this->checkIfReservedWordInUrl();

        $this->selectedNavigation->mode = $mode == false ? 'index' : $mode;

        return $this->selectedNavigation;
    }
1359792
public static function doesAnyPluginArchiveWithoutVisits()
    {
        $archivers = static::getPluginArchivers();

        foreach ($archivers as $pluginName => $archiverClass) {
            if ($archiverClass::shouldRunEvenWhenNoVisits()) {
                return true;
            }
        }

        return false;
    }
189391
public function hasChildren()
    {
        if ($this->isDot()) {
            return false;
        }
        if (is_link($this->getPathname()) && !($this->flags & self::FOLLOW_SYMLINKS)) {
            return false;
        }
        return $this->isDir();
    }
633680
public function visible()
    {
        $visible = [];

        foreach ($this->items as $path => $slug) {
            $page = $this->pages->get($path);
            if ($page !== null && $page->visible()) {
                $visible[$path] = $slug;
            }
        }
        $this->items = $visible;

        return $this;
    }
1146390
protected function canAccess()
    {
        $result = false;
        $page = Page::getByPath('/dashboard/system/basics/editor');
        if ($page && !$page->isError()) {
            $checker = new Checker($page);
            $result = $checker->canViewPage();
        }

        return $result;
    }