<commit_before><?php
class Vpc_Directories_Category_View_Component
    extends Vpc_Directories_List_ViewPage_Component
{
    public static function getSettings()
    {
        $ret = parent::getSettings();
        $ret['placeholder']['linkPrefix'] = '';
        return $ret;
    }

    public function getItemCountCacheId($row)
    {
        // Row kann von hier (Model) oder von Admin (DB-Row) kommen
        $c = $this->getData();
        while ($c) {
            $isSubroot = Vps_Component_Abstract::getFlag($c->componentClass, 'subroot');
            if ($isSubroot) {
                $highestSubRoot = $c;
            }
            $c = $c->parent;
        }
        if (!$highestSubRoot) {
            $cacheClass = '';
        } else {
            $cacheClass = $highestSubRoot->componentClass;
        }

        if ($row instanceof Vps_Model_Row_Interface) $row = $row->getRow();
        return $cacheClass.'VpcDirectoriesCategoryTreeViewComponent_category'.get_class($row->getTable()).$row->id.'_itemCount';
    }

    public static function getItemCountCache()
    {
        $frontendOptions = array('lifetime' => 3600);
        $backendOptions = array('cache_dir' => 'application/cache/component/');
        return Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions);
    }

    protected function _getCountCategoryIds($item)
    {
        return array($item->row->id);
    }

    protected function _getItems()
    {
        $items = parent::_getItems();

        $cache = self::getItemCountCache();

        foreach ($items as &$item) {
            $cacheId = $this->getItemCountCacheId($item->row);

            if (($item->listCount = $cache->load($cacheId)) == false) {
                if (!isset($itemDirectory)) {
                    $itemDirectory = $this->getData()->parent->getComponent()->getItemDirectory();
                }<commit_msg>Fix wegen Brancheneintraege anzahl<commit_after><?php
class Vpc_Directories_Category_View_Component
    extends Vpc_Directories_List_ViewPage_Component
{
    public static function getSettings()
    {
        $ret = parent::getSettings();
        $ret['placeholder']['linkPrefix'] = '';
        return $ret;
    }

    public function getItemCountCacheId($row)
    {
        // Row kann von hier (Model) oder von Admin (DB-Row) kommen
        $c = $this->getData();
        while ($c) {
            $isSubroot = Vps_Component_Abstract::getFlag($c->componentClass, 'subroot');
            if ($isSubroot) {
                $highestSubRoot = $c;
            }
            $c = $c->parent;
        }
        if (!$highestSubRoot) {
            $cacheClassId = '';
        } else {
            $cacheClassId = $highestSubRoot->componentId;
        }

        if ($row instanceof Vps_Model_Row_Interface) $row = $row->getRow();
        return $cacheClassId.'VpcDirectoriesCategoryTreeViewComponent_category'.get_class($row->getTable()).$row->id.'_itemCount';
    }

    public static function getItemCountCache()
    {
        $frontendOptions = array('lifetime' => 3600);
        $backendOptions = array('cache_dir' => 'application/cache/component/');
        return Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions);
    }

    protected function _getCountCategoryIds($item)
    {
        return array($item->row->id);
    }

    protected function _getItems()
    {
        $items = parent::_getItems();

        $cache = self::getItemCountCache();

        foreach ($items as &$item) {
            $cacheId = $this->getItemCountCacheId($item->row);

            if (($item->listCount = $cache->load($cacheId)) == false) {
                if (!isset($itemDirectory)) {
                    $itemDirectory = $this->getData()->parent->getComponent()->getItemDirectory();
                }
{'fraction_non_alphanumeric': 0.14059196617336153, 'fraction_numerical': 0.0021141649048625794, 'mean_word_length': 2.4346642468239565, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3821832', 'n_tokens_mistral': 1089, 'n_tokens_neox': 1059, 'n_words': 193}