<commit_before><?php

/**
 * Modulde portfolio helper
 */
class ModZtPortfolioHelper {

    static private $_portfolios = null;
    static private $_tags = null;
    static private $_map = null;

    /**
     * Get all portfolio
     * @return type
     */
    static public function getPortfolios() {
        $languageTag = JFactory::getLanguage()->getTag();
        if (empty(self::$_portfolios)) {
            $db = JFactory::getDbo();
            $query = $db->getQuery(true);
            $query->select('*')
                    ->from($db->quoteName('#__ztportfolio_items'))
                    ->where('`language`=\'' . $languageTag . '\' OR `language`=\'*\'')
                    ->order($db->quoteName('ztportfolio_item_id'));
            self::$_portfolios = $db->setQuery($query)
                    ->loadAssocList();
        }
        return self::$_portfolios;
    }

    /**
     * Map data
     * @param type $categories
     */
    static private function _mapData() {
        if (!empty(self::$_tags)) {
            if (empty(self::$_map)) {
                self::$_map = array();
                foreach (self::$_tags as $key => $item) {
                    self::$_map[$item['ztportfolio_tag_id']] = $key;
                }
            }
        }
    }

    /**
     * Get category by id
     * @param type $id
     * @return int
     */
    static public function getTag($id) {
        if (!empty(self::$_tags)) {<commit_msg>update get limit number<commit_after><?php

/**
 * Modulde portfolio helper
 */
class ModZtPortfolioHelper {

    static private $_portfolios = null;
    static private $_tags = null;
    static private $_map = null;

    /**
     * Get all portfolio
     * @return type
     */
    static public function getPortfolios($number = null) {
        
        $languageTag = JFactory::getLanguage()->getTag();
        
        if (empty(self::$_portfolios)) {
            
            $db = JFactory::getDbo();
            
            $query = $db->getQuery(true);
            
            $query->select('*')
                    ->from($db->quoteName('#__ztportfolio_items'))
                    ->where('`language`=\'' . $languageTag . '\' OR `language`=\'*\'')
                    ->order($db->quoteName('ztportfolio_item_id'));
            if($number != null){
                $query->setLimit($number);
                
            }
            self::$_portfolios = $db->setQuery($query)
                    ->loadAssocList();
        }
        return self::$_portfolios;
    }

    /**
     * Map data
     * @param type $categories
     */
    static private function _mapData() {
        if (!empty(self::$_tags)) {
            if (empty(self::$_map)) {
                self::$_map = array();
                foreach (self::$_tags as $key => $item) {
                    self::$_map[$item['ztportfolio_tag_id']] = $key;
                }
            }
        }
    }

    /**
     * Get category by id
     * @param type $id
     * @return int
     */
    static public function getTag($id) {
        if (!empty(self::$_tags)) {
{'fraction_non_alphanumeric': 0.15584415584415584, 'fraction_numerical': 0.0, 'mean_word_length': 1.6065989847715736, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 26, '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': '3203804', 'n_tokens_mistral': 894, 'n_tokens_neox': 872, 'n_words': 175}